php web引擎缓存加速优化
lamp基础 web环境准备
centos 6.5_64 Apache/2.2.27 (Unix) mysql5.1.72 php5.3.27
/application/apache/bin/apachectl -V
Server version: Apache/2.2.27 (Unix)
cat /application/apache/build/config.nice 查看编译的参数
grep CONFIGURE /application/mysql/bin/mysqlbug
/application/php/bin/php -i | grep configure
lnmp
centos 6.5_64 nginx/1.6.3 mysql-5.5.32 php5.5.32
# /application/nginx/sbin/nginx -V
nginx version: nginx/1.6.3
安装php eaccelerator缓存加速模块
eaccelerator-0.9.6.tar.bz2 缓存优化加速
tar jxf eaccelerator-0.9.6.tar.bz2
cd eaccelerator-0.9.6
/application/php/bin/phpize 建立php的外挂模块
./configure --enable-eaccelerator=shared --with-php-config=/application/php/bin/php-config
make && make install
ls /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/
eaccelerator.so
xcache-1.3.2.tar.bz2缓存加速模块 PHP opcode缓存器 效果更好 和eacc是二选一
tar jxf xcache-1.3.2.tar.bz2
cd xcache-1.3.2
/application/php/bin/phpize
./configure --enable-xcache --with-php-config=/application/php/bin/php-config
make && make install
ls /application/php5.3.27/lib/php/extensions/no-debug-non-zts-20090626/
eaccelerator.so xcache.so
ls /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/ =====apache
ls /application/php5.3.27/lib/php/extensions/no-debug-non-zts-20090626/ =====nginx
缓存加速器种类
xcache > eaccelerator Zend apc
本文出自 “何全” 博客,请务必保留此出处http://hequan.blog.51cto.com/5701886/1769879
原文地址:http://hequan.blog.51cto.com/5701886/1769879