升级php至5.6
1、重命名之前版本的安装路径/usr/local/php/ 为 /usr/local/php20170504/
2、下载php5.6
cd /usr/local/src
wget http://www.php.net/distributions/php-5.6.22.tar.gz
3、解压
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo
5、修改php-fpm配置文件
cd /usr/local/php/etc/
mv php-fpm.conf.default php-fpm.conf
6、将nginx下的所有.conf文件里的
fastcgi_pass unix:/tmp/php-cgi.sock
改成fastcgi_pass 127.0.0.1:9000;
7、重启
cp /usr/src/php-5.6.22/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
/etc/init.d/php-fpm restart #或者service php-fpm restart
service nginx restart
注: /usr/local/php/bin/php -i | grep php.ini #查询php当前加载的是哪个路径下的php.ini