PHP扩展缓存加速安装

所需要软件:
eaccelerator-0.9.6.1.tar.bz2
memcache-2.2.5.tgz
PDO_MYSQL-1.0.2.tgz
ImageMagick-6.6.1-10.tar.gz
imagick-2.3.0.tgz
ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
---------------------------------------
eaccelerator PHP解析cache加速
 
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
 
memcache client ext
 
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
 
Zend framework
 
tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2
/usr/local/php/bin/phpize  
./configure
--with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make
make install
cd ..
 
ImageMagick(图片处理)
 

 

tar zxvf ImageMagick-6.6.1-10.tar.gz
cd ImageMagick-6.6.1-10
./configure
make
make install
cd ..
tar zxvf imagick-2.3.0.tgz
cd imagick-2.3.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
 
Zend php解析cache加速
 
tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.9-linux-glibc23-i386
cd data/5_2_x_comp
cp ZendOptimizer.so /usr/local/php/lib/php/extensions/no-debug-zts-20060613/
cd ..
ll /usr/local/php/lib/php/extensions/no-debug-zts-20060613/
 
配置相关PHP的扩展
-------------------------------------------
 
vi /usr/local/php/lib/php.ini
查找 extension_dir="./"  (约486行)   
添加路径
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20060613/"
 
在结尾处添加下面几行,保存退出
  extension=memcache.so
  extension=pdo_mysql.so
  extension=imagick.so
 
配置eaccelerator加速PHP解析
 
mkdir -p /tmp/eaccelerator
chmod -R 777 /tmp/eaccelerator
vi /usr/local/php/lib/php.ini
在结尾处添加下面几行(注意:放在Zend配置前)
[eaccelerator]  
extension=eaccelerator.so  
eaccelerator.shm_size="64"  
eaccelerator.cache_dir="/tmp/eaccelerator"  
eaccelerator.enable="1"  
eaccelerator.optimizer="1"  
eaccelerator.check_mtime="1"  
eaccelerator.debug="0"  
eaccelerator.filter=""  
eaccelerator.shm_max="0"  
eaccelerator.shm_ttl="3600"  
eaccelerator.shm_prune_period="3600"  
eaccelerator.shm_only="0"  
eaccelerator.compress="1"  
eaccelerator.compress_level="9"  
 
配置完毕!
 
#/usr/local/php/bin/php -v               //检查加速情况配置
#ls -l /tmp/eaccelerator                 //检查是否有缓存内容,有就正常啦
打开浏览器查看PHP测试页,看memcache插件是否已生效

转载请注明: 转载自http://www.elain.org

本文链接地址:PHP扩展缓存加速安装

你可能感兴趣的:(PHP,memcache,Zend,eaccelerator,ImageMagick)