1. Download the PHP installation package
Http://cn2.php.net/get/php-5.5.36.tar.gz/from/this/mirror
By default, Nginx and PHP have a little feeling between them. Apache+php compiled after the module file is generated, and nginx+php need PHP to generate executable files, so to use fastcgi technology to implement Nginx and PHP integration, this as long as we install the fastcgi can be enabled. This time we install PHP not only use the fastcgi, but also use php-fpm such a thing, PHP-FPM is a management fastcgi a manager, it as a plugin for PHP exists, In the installation of PHP to use PHP-FPM will need to PHP-FPM as a patch installed in PHP, and PHP to be consistent with the PHP-FPM version, it is necessary, remember!
2. Installation
[Email protected] src]#Tar-ZXVF php-5.5. $.Tar. gz [[email protected] src]# CD PHP-5.5. $[[email protected] PHP-5.5. $]#./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-png-dir=/usr/local/libpng--with-jpeg-dir=/usr/local/jpeg--with-freetype-dir=/usr/local/freetype--with-zlib-dir=/usr/local/zlib--with-mcrypt=/usr/local/libmcrypt--with-libxml-dir=/usr/local/libxml2/--with-iconv-dir=/usr/local/libiconv--enable-libxml--enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inl Ine-optimization--enable-opcache--enable-mbregex--enable-fpm--enable-mbstring=all--enable-gd-native-ttf- -with-openssl--enable-pcntl--enable-sockets--with-xmlrpc--enable-Zip--enable-soap--without-pear--with-gettext--enable-session--with-curl--enable-ctype--enable-shared--wi th-GD [[email protected] PHP-5.5. $] Makeclean[[email protected] PHP-5.5. $] Make[[email protected] PHP-5.5. $] Make Install
3. Copy the php.ini-development in the source code to the set php.ini search path.
[Email protected] php-5.5. $ CP Php.ini-development/usr/local/php/etc/php.ini
4. Copy an PHP-FPM configuration file named php-fpm.conf (/usr/local/php/etc path)
CP Php-fpm.conf.default php-fpm.conf
5. Start PHP-FPM
[Email protected]/]#/usr/local/php/sbin/php-FPM [[email protected]/]#PSAux |grepphp-Fpmroot7790 0.0 0.2 27300 3048? Ss A: at 0:xxPhp-fpm:master Process (/usr/local/php/etc/php-fpm.conf) Nobody7791 0.0 0.4 27300 4380? S A: at 0:xxphp-Fpm:pool www Nobody7792 0.0 0.2 27300 2524? S A: at 0:xxphp-Fpm:pool www root8124 0.0 0.0 4420 756pts/3S+ at: + 0:xx grepphp-fpm
Report:
1. Find the PHP configuration file path
[Email protected]/]#/usr/local/php/bin/php--/usr/local/php/etcloaded Configuration File: / usr/local/php/etc/for in: (none) Additional. ini files parsed: (none)
2. Close PHP-FPM
Killall php-fpm
Linux PHP compilation installation