First go to the http://php-fpm.org/downloads/ to download the php-5.2.10-fpm-0.5.13.diff.gz, and then download the php source code php-5.2.10.tar.bz2
Then run the following command:
| The code is as follows: |
Copy code |
Tar jxf php-5.2.10.tar.bz2 Cd php-5.2.10 Gunzip-c ../php-5.2.10-fpm-0.5.13.diff.gz | patch-p1 Apt-get install build-essential libxml2-dev libmcrypt-dev libssl-dev libldap2-dev libmhash-dev libmysqlclient15-dev libcurl4-openssl-dev libpng12-dev libjpeg-dev libsasl2-dev . /Configure -- prefix =/opt/php -- with-iconv -- with-zlib -- enable-xml -- disable-rpath -- enable-discard-path -- enable-safe-mode -- enable- bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- with-curlwrappers -- enable-mbregex -- enable-fastcgi -- enable-fpm -- enable-force- cgi-redirect -- enable-mbstring -- with-mcrypt -- with-gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets -- with-ldap -- with-ldap-sasl -- with-xmlrpc -- enable-zip -- enable-soap -- without-pear -- with-mysql -- with-mysqli -- enable-sqlite-utf8 -- with-pdo- mysql -- enable-ftp -- with-jpeg-dir -- with-freetype-dir -- With-png-dir Make Make install Cp php. ini-dist/opt/php/lib/php. ini Ln-s/opt/php/sbin/php-fpm/etc/init. d/php-fpm Update-rc.d-f php-fpm defaults /Etc/init. d/php-fpm start
|
The compiled php is installed under/opt/php. The php configuration file is
| The code is as follows: |
Copy code |
/Opt/php/lib/php. ini
|
Then run
| The code is as follows: |
Copy code |
| /Etc/init. d/php-fpm start |
You can start the fastcgi process of php. These php fastcgi processes should work properly.
Optimize php-fpm
Edit the configuration file/opt/php/etc/php-fpm.conf for php-fpm,
Remove the comments of display_errors and change the parameter value to 1.
Comment remove the comment of the sendmail_path parameter
Comment Remove user and group parameter comments
Modify the value of max_children to 50