wget http://cn2.PHP.net/distributions/PHP-5.6.2.tar.gz
tar -zxvf PHP-5.6.2.tar.gz
cd PHP-5.6.2
./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=MysqLnd --with-MysqL-sock=/tmp/MysqL.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl
make
make install
echo "export PATH=$PATH:/usr/local/PHP/bin" >>/etc/profile
source /etc/profile
cp /usr/local/PHP/etc/PHP-fpm.conf.default PHP-fpm.conf
修改PHP的配制文件PHP-fpm.conf (在安装目录的etc子目录下)
cp ./PHP-5.6.2/sapi/fpm/init.d.PHP-fpm /etc/init.d/PHP-fpm
user = user
group = user
设置权限,并添加服务
chmod +x /etc/init.d/PHP-fpm
chkconfig --add PHP-fpm
以后可以使用如下命令管理PHP-fpm了
service PHP-fpm start service PHP-fpm stop service PHP-fpm restart service PHP-fpm reload
原文链接:https://www.f2er.com/centos/380878.html