标签:
第一步:安装所需的包
yum install wget make gcc gcc-c++ bison autoconf patch pcre-devel zlib-devel openssl-devel net-snmp-devel ncurses-devel libxml2-devel bzip2-devel gd-devel libcurl-devel mysql-devel memcached libtool-ltdl-devel
第二步:安装libmcrypt
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz tar zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8 ./configure make make install
第三步:下载php-5.2.17以及php-fpm补丁包
wget http://museum.php.net/php5/php-5.2.17.tar.bz2 tar jxvf php-5.2.17.tar.gz wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
第四步:编译安装PHP
./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --enable-gd-native-ttf --enable-gd-jis-conv --enable-soap --enable-zip --enable-pcntl --enable-sockets --enable-mbstring --enable-xml --with-bz2 --with-openssl --with-iconv --with-zlib --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mcrypt --with-mysql --with-mysqli make make install
第五步:编译安装memcache扩展
先到http://pecl.php.net/package/memcache找到最新稳定版
wget http://pecl.php.net/get/memcache-2.2.7.tgz tar zxvf memcache-2.2.7.tgz cd memcache-2.2.7 /usr/local/php/bin/phpize ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir make make install
第六步:配置memcache扩展
编辑文件/usr/local/php/lib/php.ini
写入下面内容
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ extension=memcache.so
第七步:配置php-fpm扩展
编辑文件/usr/local/php/etc/php-fpm.conf
找到下面代码
Unix user of processes <!-- <value name="user">nobody</value> --> Unix group of processes <!-- <value name="group">nobody</value> -->
去掉里面的<!--的标记
第八步:测试启动php-fpm服务
执行指令
/usr/local/php/sbin/php-fpm start
查看9000端口是否监听
netstat -anp|grep 9000
将其写入/etc/rc.local以便开机自动运行
CentOS6.6安装PHP5.2.17(20150123)
标签:
原文地址:http://www.cnblogs.com/firadio/p/4243736.html