0 安装PHP依赖包
yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel openldap openldap-devel -y
1 下载PHP安装文件(我用的版本 5.6.34) 并解压
tar -xvf php-5.6.34.tar.gz
2 使用参数编译 (以下为推荐参数,可以满足大部分情况,根据自己实际情况修改参数)
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc/ --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-bcmath --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --with-ldap
3 安装
make &