原文地址:http://www.debianhelp.co.uk/eaccelerator.htm
在Debian中配置eAccelerator
What is eAccelerator?
eAccelerator is a further development from mmcache PHP Accelerator & Encoder. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated.
Installing eAcceleration in Debian
第一步,下载并安装php5-dev,编译eAccelerator的时候会用到
#apt-get install php5-dev
下载eAccelerator 源码包,并加压缩
#tar jxvf eaccelerator-0.9.5.3.tar.bz2
#cd eaccelerator-0.9.5
用phpize常见编译时需要的配置文件
#/usr/bin/phpize
#./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config
#make
#make install
安装完成
在 /etc/php5/apache2/php.ini 中加入如下配置
extension=eaccelerator.so
[eaccelerator]
eaccelerator.shm_size=16
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=0
eaccelerator.shm_prune_period=0
eaccelerator.shm_only=0
eaccelerator.compress=1
eaccelerator.compress_level=9
为eAccelerator创建临时目录
#mkdir /tmp/eaccelerator
#chmod 777 /tmp/eaccelerator
重启apache
#/etc/init.d/apache2 restart
测试是否安装完成
在apache目录下创建下面的文件并在浏览器中查看
<?php
phpinfo();
?>
能够找到eAccelerator的信息就表示已经安装成功可以使用了