First, unzip PHP
[Email protected] src]# tar jxf php-5.6.14.tar.bz2
[Email protected] src]# CD php-5.6.14
Second, create PHP-related users
[Email protected] php-5.6.14]# useradd-s/sbin/nologin php-fpm
Third, compile and install PHP
[Email protected] php-5.6.14]#/configure \
>--prefix=/usr/local/php \
>--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC \
>--ENABLE-FPM \
>--WITH-FPM-USER=PHP-FPM \
>--WITH-FPM-GROUP=PHP-FPM \
>--with-mysql=/usr/local/mysql \
>--with-mysql-sock=/var/lib/mysql/mysql.sock \
>--with-mysqli=/usr/local/mysql/bin/mysql_config \
>--with-freetype-dir=/usr/local/freetype \
>--with-jpeg-dir=/usr/local/jpeg6 \
>--with-mcrypt=/usr/local/libmcrypt \
>--WITH-GD=/USR/LOCAL/LIBGD2 \
>--with-iconv-dir=/usr/local/libiconv \
>--with-png-dir \
>--with-zlib \
>--with-libxml-dir \
>--with-curl \
>--with-mhash \
>--with-openssl \
>--with-pear \
>--enable-soap \
>--enable-gd-native-ttf \
>--enable-ftp \
>--enable-mbstring \
>--enable-exif \
>--enable-zend-multibyte \
>--disable-ipv6 \
>--enable-bcmath \
>--ENABLE-SHMOP \
>--enable-sysvsem \
>--with-pcre-dir
Configure:WARNING:unrecognized options:--enable-zend-multibyte (unsupported parameter)
[[email protected] php-5.6.14]# make && make install
[Email protected] php-5.6.14]# ls/usr/local/php/
Bin etc include Lib Php sbin var
1. Copy PHP master configuration file
[email protected] php-5.6.14]# CP Php.ini-production/usr/local/php/etc/php.ini
2. Copy startup script
[email protected] php-5.6.14]# CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM
[Email protected] php-5.6.14]# chmod 755/etc/init.d/php-fpm
[Email protected] php-5.6.14]# chkconfig--add php-fpm
[Email protected] php-5.6.14]# chkconfig php-fpm on
3. Copy PHP-FPM configuration file
[Email protected] php-5.6.14]# mv/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
[Email protected] php-5.6.14]# ls/usr/local/php/etc/
pear.conf php-fpm.conf php.ini
4. Check Configuration errors
[Email protected] php-5.6.14]#/usr/local/php/sbin/php-fpm-t
[16-dec-2015 14:16:26] Notice:configuration file/usr/local/php/etc/php-fpm.conf Test is successful
5. Start PHP-FPM
[[Email protected] php-5.6.14]# service PHP-FPM start
Starting php-fpm Done
6. Review the process
[[Email protected] php-5.6.14]# PS aux | grep php-fpm
Root 16922 0.0 0.4 129188 4988? Ss 14:17 0:00 php-fpm:master process (/usr/local/php/etc/php-fpm.conf)
PHP-FPM 16923 0.0 0.4 129188 4636? s 14:17 0:0 0 Php-fpm:pool www &NBS P , &NB Sp , &NB Sp  
PHP-FPM 16924 0.0 0.4 129188 4636? S 14:17 0:00 Php-fpm:pool www
Root 16927 0.0 0.0 103248 876 pts/0 s+ 14:18 0:00 grep php-fpm
7. Viewing the Listening port
[Email protected] php-5.6.14]# NETSTAT-NLTP | grep php-fpm
TCP 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 16922/php-fpm
1.8LNMP Environment Compilation Installation php-5.6.14