安装xcache
# 解压tar -zxvf xcache-3.2.0.tar.gzcd xcache-3.2.0/usr/local/php/bin/phpize# 配置./configure --enable-xcache--enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/local/php/bin/php-configmake #编译make install #安装
创建xcache缓存文件
touch /tmp/xcache #创建文件chmod 777 /tmp/xcache #设置权限# 创建xcache管理员密码为123456echo -n "123456" | md5sum #记住类似下面一行代码(md5加密之后的密码),后面会用到e10adc3949ba59abbe56e057f20f883e4、拷贝xcache后台管理程序到网站根目录cp -r /data/soft/opcode/xcache-3.2.0/htdocs/ /usr/local/httpd/htdocs/xcache/chown www.www -R /usr/local/httpd/htdocs/xcache/ #设置xcache目录和网站目录权限相同# 配置php支持xcachevim /usr/local/php/etc/php.ini #编辑配置文件,在Dynamic Extensions后添加以下内容[xcache-common]extension = xcache.so[xcache.admin]xcache.admin.enable_auth = Onxcache.admin.user = "xcache"xcache.admin.pass = "e10adc3949ba59abbe56e057f20f883e"[xcache]xcache.shm_scheme ="mmap"xcache.size=60Mxcache.count =1xcache.slots =8Kxcache.ttl=0xcache.gc_interval =0xcache.var_size=64Mxcache.var_count =1xcache.var_slots =8Kxcache.var_ttl=0xcache.var_maxttl=0xcache.var_gc_interval =300xcache.test =Offxcache.readonly_protection = Onxcache.mmap_path ="/tmp/xcache"xcache.coredump_directory =""xcache.cacher =Onxcache.stat=Onxcache.optimizer =Off[xcache.coverager]xcache.coverager =Onxcache.coveragedump_directory ="":wq! #保存退出# Nginx测试service php-fpm restart #重启php-fpmservice nginx restart #重启nginx# Apache测试service httpd restart #重启apache浏览器打开网站根目录下面的xcache输入用户名xcache 密码123456