听说kloxo里面默认的xcache不稳定,于是我决定关闭xcache然后自己编译上eaccelerator,以下方法为半原创.
首先确定自己有否安装make模块
如果没有,请执行复制内容到剪贴板代码:
yum install make
接着执行下面的命令复制内容到剪贴板代码:
wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
tar xjf eaccelerator-0.9.6.tar.bz2
cd eaccelerator-0.9.6
/usr/bin/phpize
./configure –enable-eaccelerator=shared –with-php-config=/usr/bin/php-config
make
make install
cd ..
rm -rf eaccelerator-0.9.6
rm eaccelerator-0.9.6.tar.bz2
mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator
然后在/etc/php.d/中创建一个eaccelerator.ini
命令: vim /etc/php.d/eaccelerator.ini
创建好之后编辑这个文件,开始编辑这个文件:
命令: i
进入编辑状态后根据你的VPS是openVZ还是XEN选择复制下面代码 1.OPENVZ复制内容到剪贴板代码:
extension=”eaccelerator.so”
eaccelerator.shm_size=”0″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.log_file = “/var/log/eaccelerator_log”
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.keys = “disk_only”
eaccelerator.sessions = “disk_only”
eaccelerator.content = “disk_only”
2.Xen复制内容到剪贴板代码:
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.log_file = “/var/log/eaccelerator_log”
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.keys = “shm_and_disk”
eaccelerator.sessions = “shm_and_disk”
eaccelerator.content = “shm_and_disk”
然后ctrl+c 退出编辑模式。
Caps Lock进入大写模式,连按两下Z退出到SSH命令行。
7.然后重启apache生效:
service httpd restart
如果是你用的Lighttpd就重启Lighttpd:
service lighttpd restart
即可完美与kloxo现有zend兼容,无需一个个站点的php.ini文件修改过来.
声明: 本文采用 BY-NC-SA 协议进行授权 | 漏网小鱼博客
转载请注明转自《kloxo上安装eaccelerator加速器[本站装上使用了]》
1楼 于 2012-1-13 08:38
我爱你们往往是太多。这种巧妙的工作和覆盖!保持的好作品,我补充说:你们的网志串连的球员。
2楼 于 2012-1-12 14:22
嘿!我可以发誓,我去过这个博客,但通过一些后检查后,我意识到它的新的给我。无论如何,我肯定高兴,我发现它,我将书标记和检查经常回来!
3楼 于 2011-6-23 21:15
Howdy I am so grateful I found your webpage, I really found you by error, while I was looking on Aol for something else, Anyways I am here now and would just like to say thank you for a marvelous post and a all round entertaining blog (I also love the theme/design), I don抰 have time to go through it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the excellent work.