centos6.3(final) 编译安装php5.6

前端之家收集整理的这篇文章主要介绍了centos6.3(final) 编译安装php5.6前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


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

将@PHP_fpm_user@改为当前系统的用户名

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

猜你在找的CentOS相关文章