DirectAdmin添加Xcache

发布时间:2015年11月22日 阅读:22902次 分类:CentOS应用 3 条评论

XCache 是一个开源的 opcode 缓存器/优化器, 这意味着他能够提高您服务器上的 PHP 性能。 他通过把编译 PHP 后的数据缓冲到共享内存从而避免重复的编译过程,能够直接使用缓冲区已编译的代码从而提高速度.,通常能够提高您的页面生成速率 2 到5 倍,且还能降低服务器负载。


一、下载并安装


cd /usr/local/src/
wget http://xcache.lighttpd.net/pub/Releases/2.0.1/xcache-2.0.1.tar.gz
tar -zxvf xcache-2.0.1.tar.gz
cd xcache-2.0.1
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/php5/bin/phpize
./configure --enable-xcache -with-php-config=$PHP_PREFIX/php5/bin/php-config
make && make install

二、安装完毕,调用


修改PHP.INI【如DirectAdmin的SuPHP模式安装的在/usr/local/etc/php5/cgi】
将以下内容加到ZEND上面:


[xcache-common]
zend_extension = /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/xcache.so
[xcache.admin]
xcache.admin.user = "admin"
xcache.admin.pass = ""
; xcache.admin.pass = md5($your_password)
xcache.admin.enable_auth = On
[xcache]
xcache.cacher =               On
xcache.size  =               64M
xcache.count =                 1
xcache.slots =                8K
xcache.ttl   =              3600
xcache.gc_interval =         300
xcache.var_size  =            0M
xcache.var_count =             1
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300
xcache.readonly_protection = Off
xcache.mmap_path =    "/dev/zero"

三、重启APACHE


service httpd restart

标签: directadmin, xcache

已有 3 条评论 »

  1. 香港独立IP主机 香港独立IP主机

    开源的 opcode 缓存器/优化器,提高服务器上的 PHP 性能,虽然不难但是我感觉我还是会出错

  2. 点我收录您 点我收录您

    这个教程很实用 感谢分享!

  3. AdOnCn AdOnCn

    很不错,谢谢。

添加新评论 »




captcha
请输入验证码