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

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...