php安装包下载
`wget https://www.php.net/distributions/php-5.6.19.tar.bz2
#解压
bunzip2 php-5.6.19.tar.bz2
tar xvf php-5.6.19.tar
#安装依赖包
yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel gd gd-devel
`
开始安装PHP
tar -zxvf php-5.6.31.tar.gz
cd php-5.6.31
./configure --prefix=/usr/local/php5.6 --disable-debug --enable-shared --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-libxml-dir --with-openssl --with-bz2 --with-mcrypt --enable-gd-native-ttf --with-curl --with-zlib-dir -with-gettext --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv --with-config-file-path=/usr/local/php5.6/etc --enable-mbstring --with-gd --disable-debug --enable-short-tags --disable-posix --enable-exif --enable-ftp --enable-sockets --with-mhash --enable-zip
make
make install
cp php.ini-production /usr/local/php5.6/etc/php.ini
cp php.ini-production /usr/local/php5.6/etc/php.ini
cd /usr/local/php5.6/etc
cp php-fpm.conf.default php-fpm.conf
cp -rf sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
#环境变量配置
`echo “export PHP_HOME=/usr/local/php5.6” >> /etc/profile
source /etc/profile`
#增加开机启动
chkconfig --add php-fpm
chkconfig php-fpm on
#启动php
service php-fpm start
#验证是否已经启动
php -v
能正确打印版本号说明是安装成功·