CentOS 安装php 5.6

wget http://cn2.php.net/distributions/php-5.6.23.tar.gz
tar xvf php-5.6.23.tar.gz
cd php-5.6.23
yum install freetype-devel libjpeg-devel libpng-devel curl-devel libxml2 libxml2-devel gcc gcc-c++ openssl-devel
./configure --prefix=/usr/local/php-5.6.23 --with-config-file-path=/usr/local/php5.6.23/etc  --enable-bcmath --enable-mbstring --enable-sockets --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf  --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-openssl
make && make install
echo "PATH=$PATH:/usr/local/php-5.6.23/bin:/usr/local/php-5.6.23/sbin" >> /etc/profile
cp php.ini-production /usr/local/php-5.6.23/etc/php.ini
cd /usr/local/php-5.6.23/etc
cp php-fpm.conf.default php-fpm.conf
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
/usr/local/php-5.6.23/sbin/php-fpm -t
service php-fpm start
netstat -ntlp
chkconfig --add php-fpm && chkconfig php-fpm on

你可能感兴趣的:(CentOS 安装php 5.6)