第一步:安装依赖关系
[root@node1 ~]# yum -y install openssl-devel swig libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel libcurl libcurl-devel libmcrypt-devel mhash-devel mcrypt-devel
第二步:下载php程序
[root@node1 src]# wget http://soft.51yuki.cn/php-5.6.33.tar.gz
第三步:安装php程序
[root@node1 src]# tar xf php-5.6.33.tar.gz
[root@node1 src]# cd php-5.6.33
[root@node1 php-5.6.33]# useradd www
[root@node1 php-5.6.33]# ./configure --prefix=/usr/local/php-fastcgi --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --with-libxml-dir --with-curl --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --with-openssl --enable-mbstring --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr/lib64 --with-gettext=/usr/lib64 --enable-sockets --with-xmlrpc --enable-zip --enable-soap --disable-debug --enable-opcache --enable-zip --with-config-file-path=/usr/local/php-fastcgi/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www && make && make install
第四步:配置php
[root@node1 php-5.6.33]# cp php.ini-production /usr/local/php-fastcgi/etc/php.ini
[root@node1 php-5.6.33]# cd /usr/local/php-fastcgi/etc/
[root@node1 etc]# cp php-fpm.conf.default php-fpm.conf
[root@node1 php-5.6.33]# cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
cp: overwrite `/etc/rc.d/init.d/php-fpm‘? y
[root@node1 php-5.6.33]# chmod u+x /etc/init.d/php-fpm
第五步:启动php
[root@node1 php-5.6.33]# service php-fpm start
Starting php-fpm done
[root@node1 php-5.6.33]# ss -tunlp|grep 9000
tcp LISTEN 0 128 10.100.100.105:9000 *:* users:(("php-fpm",3166,7),("php-fpm",3167,0),("php-fpm",3168,0))
http://soft.51yuki.cn/php-5.6.33.tar.gz