#下载并且解压缩php5.6.3源码
cd ~
http://cn2.php.net/distributions/php-5.6.3.tar.gz
tar zxvf php-5.6.3.tar.gz -C /usr/local/src
#安装缺少的依赖
yum install libxml2-devel gd-devel libmcrypt-devel libcurl-devel openssl-devel
#编译
./configure --prefix=/usr/local/php56 --with-config-file-path=/usr/local/php56/etc --with-mysql --with-gd --with-openssl --with-fpm-user=nginx --with-fpm-group=nginx --with-zlib --with-mhash --with-pcre-regex --with-iconv --with-curl --with-pear --with-pdo-mysql --enable-fileinfo --enable-mbstring --enable-mysqlnd --enable-opcache --enable-sockets --enable-pcntl --with-libxml-dir --enable-bcmath --enable-dom --enable-fpm --enable-mysqlnd-compression-support --enable-ftp --without-pdo-sqlite --without-sqlite3 --with-gd --with-jpeg-dir --with-freetype-dir --enable-shared
#安装
make
make install
#做两个软连接
ln -s /usr/local/php56/bin/php /usr/local/bin/php
ln -s /usr/local/php56/bin/phpize /usr/local/bin/phpize
#复制配置文件
cp /usr/local/src/php-5.6.3/php.ini-production /usr/local/php56/etc/php.ini
cp /usr/local/php56/etc/php-fpm.conf.default /usr/local/php56/etc/php-fpm.conf
#复制fpm启动管理脚本
cp /usr/local/src/php-5.6.3/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
#修改php-fpm.conf配置参数
vi /usr/local/php56/etc/php-fpm.conf
去掉pid和error_log前面的分号
#加入开机启动
# chkconfig --add php-fpm
# chkconfig php-fpm on
service php-fpm start