安装一些依赖的包
wget -c ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz tar xf libxml2-2.7.8.tar.gz -C ../source/ cd ../source/libxml2-2.8.7/ ./configure --prefix=/usr/local/services make && make install
cd -
wget http://curl.haxx.se/download/curl-7.21.4.tar.gz tar xf curl-7.21.4.tar.gz -C ../source/ cd ../source/curl-7.21.4/ ./configure --prefix=/usr/local/services make && make install
cd -
wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz tar xf jpegsrc.v8b.tar.gz -C ../source/ cd ../source/jpeg-8b/ ./configure --prefix=/usr/local/services make && make install
cd -
wget http://download.sourceforge.net/libpng/libpng-1.6.2.tar.gz tar xf libpng-1.6.2.tar.gz -C ../source/ cd ../source/libpng-1.6.2/ ./configure --prefix=/usr/local/services make && make install
cd -
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.11.tar.gz tar xf freetype-2.4.11.tar.gz -C ../source/ cd ../source/freetype-2.4.11/ ./configure --prefix=/usr/local/services make && make install cd -
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar xf libevent-2.0.21-stable.tar.gz -C ../source/
cd ../source/libevent-2.0.21-stable/ ./configure --prefix=/usr/local/services --disable-debug-mode
make && make install
cd -
wget https://sourceforge.net/projects/re2c/files/0.15.3/re2c-0.15.3.tar.gz tar xf re2c-0.15.3.tar.gz -C ../source/ cd ../source/re2c-0.15.3/ ./configure --prefix=/usr/local/services
make && make install
cd -
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar xvf libmcrypt-2.5.7.tar.gz -C ../source/
cd ../source/libmcrypt-2.5.7/
./configure --prefix=/usr/local/services
make && make install
cd -
一些devel包(缺少各种库,,,一步一个坑)
yum install libxml2-devel -y yum install libcurl-devel -y yum install libjpeg-devel -y yum install libpng-devel -y yum install freetype-devel -y
yum install openldap-devel
mcrypt.h not found. Please reinstall libmcrypt”的解决方法参考:http://www.linuxidc.com/Linux/2015-08/121079.htm
wget http://cn2.php.net/distributions/php-5.6.13.tar.gz
tar xf php-5.6.13.tar.gz -C ../source/
cd ../source/php-5.6.13
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts --with-libdir=lib64 --with-ldap
make && make instal
cd -
#复制配置文件 cp php.ini-production /usr/local/php/etc/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
至此PHP安装部分OK
后面仅供参考:
./configure后面的参数来源于:http://www.tuicool.com/articles/ZJfYzyF
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=daemon --with-fpm-group=daemon --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
make && install
#configure: WARNING: unrecognized options: --enable-magic-quotes, --enable-safe-mode, --with-curlwrappers
#这里是我安装是出现的警告
如果加的参数有不支持的,提示比如:configure: WARNING: unrecognized options: --enable-discard-path, --enable-safe-mode, --enable-fastcgi, --enable-force-cgi-redirect
说明上述这些参数废弃了