Php5.2.17 and manual patching php-fpm installation 1. Install extension
Yum-y install perl-DBI curl-devel libcurl-level mysql-devel gcc-c ++ openssl-devel pcre-devel zlib-devel bzip2 bzip2-devel libxml2 libxml2-devel libmhash libmhash-devel libjpeg-devel libpng-devel
2. Download php and php-fpm
Wget http://soft.7dot.com/soft/php-5.2.17.tar.gz
Http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz wget-c
3. install and compile php
Tar zxvf php-5.2.17.tar.gz
Gzip-cd php-5.2.17-fpm-0.5.14.diff.gz | patch-d php-5.2.17-p1
Cd 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
4. possible errors in the compilation process and the error correction method
1) mcrypt. h not found. Please reinstall libmcrypt
Libmcrypt-devel cannot be installed on the centos Source. for copyright reasons, there is no mcrypt package. There are two solutions: one is to use the third-party source, which can also be installed using yum, it is simple and convenient. The disadvantage is that the third-party source may feel unreliable.
Solution 1
Install a third-party yum source
Wget http://www.atomicorp.com/installers/atomic
Use the yum command to install
Yum install php-mcrypt libmcrypt-devel
Solution 2,
Libmcrypt must be installed before using php mcrypt.
Libmcrypt source code installation method:
cd /usr/local/srcwget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gztar -zxvf libmcrypt-2.5.8.tar.gzcd /usr/local/src/libmcrypt-2.5.8./configure --prefix=/usr/localmakemake install
2) error: Cannot find libmysqlclient under/usr. Note that the MySQL client library is not bundled anymore!
The problem is that libmysqlclient is installed in the/usr/lib64/mysql/directory by default in a 64-bit system.
The/usr/lib directory does not have the corresponding files, but when php is compiled, you need to find the files in the/usr/lib directory.
Solution:
Ln-s/usr/lib64/mysql/libmysqlclient. so.16.0.0/usr/lib/libmysqlclient. so
3)/Usr/bin/ld: cannot find-lltdl
Collect2: ld returned 1 exit status
Make: *** [libphp5.la] Error 1
This problem should be due to the fact that the library's header file library is not installed.
Yum list all | grep ltdl
Yum-y install libtool-ltdl-devel.x86_64
4)
# Based On Wrote PEAR system config file at:/usr/local/php/etc/pear. conf
# You may want to add:/usr/local/php/lib/php to your php. ini include_path
# Installing PDO headers:/usr/local/php/include/php/ext/pdo/
# This information, we need to execute in the current php-5.2.17 Directory
Cp php-5.2.17/php. ini-dist/usr/local/php/lib/php. ini
5)
The following error message appears when starting the PHP-FPM:
Starting php_fpm Feb 07 10:52:35. 508786 [ERROR] fpm_unix_conf_wp (), line 124: please specify user and group other than root, pool 'default'
Open the php-fpm.conf configuration file and find the following part:
Unix user of processes
Unix group of processes
Remove the comments and change user and group to practical users and groups. For example, user = nginx group = nginx
5. start the service
/Usr/local/php/sbin/php-fpm start
Service nginx restart
Service mysqld restart
Other details are not described in detail. please advise and correct them!