原文链接:http://www.2cto.com/os/201511/450258.html
##### PHP 编译安装 ####
[[email protected] ~]# yum install libxml2-devel curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel net-snmp net-snmp-devel [[email protected] src]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz [[email protected] src]# tar zxvf libiconv-1.14.tar.gz [[email protected] src]# cd libiconv-1.14 [[email protected] libiconv-1.14]# ./configure --prefix=/usr/local/php/libiconv [[email protected] libiconv-1.14]# make && make install [[email protected] src]# wget http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz [[email protected] src]# tar zxvf libmcrypt-2.5.8.tar.gz [[email protected] src]# cd libmcrypt-2.5.8 [[email protected] libmcrypt-2.5.8]# ./configure [[email protected] libmcrypt-2.5.8]# make && make install [[email protected] libltdl]# /sbin/ldconfig && cd libltdl/ [[email protected] libltdl]# ./configure --enable-ltdl-install [[email protected] libltdl]# make && make install [[email protected] src]# wget http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz [[email protected] src]# tar zxvf mhash-0.9.9.9.tar.gz [[email protected] src]# cd mhash-0.9.9.9 [[email protected] mhash-0.9.9.9]# ./configure [[email protected] mhash-0.9.9.9]# make && make install [[email protected] src]# wget http://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz [[email protected] src]# tar zxvf mcrypt-2.6.8.tar.gz [[email protected] src]# cd mcrypt-2.6.8 [[email protected] mcrypt-2.6.8]# /sbin/ldconfig && export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH [[email protected] mcrypt-2.6.8]# ./configure [[email protected] mcrypt-2.6.8]# make && make install [[email protected] src]# wget http://cn2.php.net/distributions/php-5.6.15.tar.gz [[email protected] src]# tar zxvf php-5.6.15.tar.gz [[email protected] src]# cd php-5.6.15 [[email protected] php-5.6.15]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-iconv=/usr/local/php/libiconv --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-pear --with-freetype-dir --with-zlib --with-libxml-dir --with-iconv-dir --with-xmlrpc --with-mhash --with-mcrypt --with-curl --with-openssl --with-snmp --with-gettext --enable-pdo --enable-mbstring --enable-ctype --enable-simplexml --enable-ftp --enable-sockets --enable-gd-native-ttf --enable-sysvsem --enable-exif --enable-sysvshm --enable-xml --enable-dom --enable-simplexml --enable-shmop --enable-zip --enable-mbregex --enable-bcmath --enable-inline-optimization --enable-soap [[email protected] php-5.6.15]# make && make install [[email protected] php-5.6.15]# cp php.ini-production /usr/local/php/etc/php.ini [[email protected] ~]# ln -s /usr/local/php/bin/* /usr/sbin/
//查看版本
php -v
时间: 2024-10-25 19:27:32