1、下载php
2、安装相关组件
yum install gcc gcc-c++ curl-devel bzip2 bzip2-devel openssl openssl-devel libxml2-devel libjpeg libjpeg-devel yum install libmcrypt*
3、编译
./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt=/usr/local/libmcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysqli --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --enable-freetype --with-apxs2
make
make install
原文:http://2860664.blog.51cto.com/2850664/1554407