###准备工作
#安装“最快镜像源”插件,加速下载
yum install yum-plugin-fastestmirror.noarch
#升级系统
yum update
#安装两个软件源
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/epel-release-6-5.noarch.rpm
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/ius-release-1.0-8.ius.el6.noarch.rpm
安装xcach
wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz
tar -zxvf xcache-3.2.0.tar.gz
cd xcache-3.2.0
phpize
./configure –enable-xcache
make
make install
配置xcache
打开php.ini文件,增加如下代码:
[xcache-common]
; change me – 64 bit php => /usr/lib64/php/modules/xcache.so
; 32 bit php => /usr/lib/php/modules/xcache.so
zend_extension = /usr/lib64/php/modules/xcache.so
[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = “mOo”
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = “”
[xcache]
xcache.shm_scheme = “mmap”
xcache.size = 32M
xcache.count = 1
xcache.slots = 8K
xcache.ttl = 3600
xcache.gc_interval = 300
; Same as aboves but for variable cache
; If you don’t know for sure that you need this, you probably don’t
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
; N/A for /dev/zero
xcache.readonly_protection = Off
xcache.mmap_path = “/dev/zero”
xcache.cacher = On
xcache.stat = On
额。。。。感觉比较麻烦 不想 那个啥 写的,就去xcode的下载目录,然后cat xcache.ini >> /etc/php.ini 追加吧。
注意修改zend_extension = /usr/lib64/php/modules/xcache.so为正确的路径。
ps:贴出一块正确的配置
[xcache-common]
extension = /usr/lib/php/modules/xcache.so
[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = “admin”
xcache.admin.pass = “e10adc3949ba59abbe56e057f20f883e”
[xcache]
xcache.shm_scheme= “mmap”
xcache.size =100M
xcache.count=1
xcache.slots=8k
xcache.ttl = 3600
xcache.gc_interval=300
xcache.readonly_protection=Off
xcache.mmap_path = “/dev/zero”
xcache.cacher = On
xcache.stat = On
然后重启httpd服务,看Phpinfo里的信息展示;