How to compile and install php5.2
How to compile and install php5.2: 1. Download php; 2. Download php-fpm; 3. Install the required dependency packages; 4. Install PHP through "make install".
The operating environment of this article: linux5.9.8 system, PHP5.2 version, DELL G3 computer
How to compile and install php5.2 ?
Compile and install php5.2.17
Previously, PHP installation was directly installed by YUM, but due to business needs of the company, the program requires php5.2.x. Supported, so I started compiling and installing
1. First download php
wget -c http://us3.php.net/get/php-5.2.17.tar.gz/from/this/mirror
Because I am using lnmp here, I need to use the fastcgi manager. Here I am using php-fpm. php5.2 does not integrate php-fpm by default, so it needs to be patched. For the understanding, configuration and application of php-fpm, please see http://shuoduanzi.com/?p=288
2. Download php-fpm
wget -c http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
3. Install the required dependency packages. Here I install them with YUM
4. Okay, now look at the installation script
#!/bin/bash ############下载php和fpm补丁 cd /opt wget -c http://us3.php.net/get/php-5.2.17.tar.gz/from/this/mirror tar zxvf php-5.2.17.tar.gz cd php-5.2.17 wget -c http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz gzip -d php-5.2.17-fpm-0.5.14.diff.gz patch -p1 < php-5.2.17-fpm-0.5.14.diff ############安装所依赖的库,其实这里还依赖其它库,但是在安装这些库的时候,本身它们也有依赖,它们所依赖的库也正是我们安装php所需要的库。 yum install libxml2 libxml2-devel \ openssl openssl-devel \ curl curl-devel \ libjpeg libjpeg-devel \ gd gd-devel \ bzip2 bzip2-devel \ libmcrypt libmcrypt-devel \ libmhash libmhash-devel \ mysql mysql-devel -y ###########开始安装php cd /opt/php-5.2.17 ./configure --prefix=/usr/local/php --enable-fastcgi --enable-zip --enable-fpm --enable-gd-native-ttf --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/etc/php.d --with-bz2 --with-curl --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --with-mcrypt --with-mhash --enable-mbstring --with-kerberos --with-gettext --enable-bcmath --with-mysql --with-mysqli --with-sqlite --enable-pdo --with-pdo-mysql --with-openssl --enable-ftp --with-pear --with-zlib --enable-inline-optimization --enable-calendar --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --disable-debug make make test make install
Supplementary content:
This is the compilation method when I use nginx php, but in the case of apache php, you cannot add the two parameters --enable-fastcgi --enable-fpm, otherwise an error will be reported when apache starts after installation.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to compile and install php5.2. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

PHP 8's JIT compilation enhances performance by compiling frequently executed code into machine code, benefiting applications with heavy computations and reducing execution times.

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

The article discusses symmetric and asymmetric encryption in PHP, comparing their suitability, performance, and security differences. Symmetric encryption is faster and suited for bulk data, while asymmetric is used for secure key exchange.

The article discusses implementing robust authentication and authorization in PHP to prevent unauthorized access, detailing best practices and recommending security-enhancing tools.

The article discusses strategies to prevent CSRF attacks in PHP, including using CSRF tokens, Same-Site cookies, and proper session management.

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.
