wget http://xcache.lighttpd.net/pub/Releases/3.0.0/xcache-3.0.0.tar.gz
tar zxvf xcache-3.0.0.tar.gz
cd xcache-3.0.0
/usr/local/php-5.2.17/bin/phpize
./configure -with-php-config=/usr/local/php-5.2.17/bin/php-config -enable-xcache -enable-xcache-coverager -enable-inline-optimization -disable-debug
make
make install
vi /usr/local/php-5.2.17/etc/php.ini
在文件末尾添加:
extension = "xcache.so" #你的安装路径
xcache.admin.auth = On
xcache.admin.user = "xcache"
xcache.admin.pass = "5f4dcc3b5aa765d61d8327deb882cf99" #password is password
xcache.size = 32M
xcache.shm_scheme = "mmap"
xcache.count = 4
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 16M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = On
xcache.coveragedump_directory = ""
拷贝htdocs到WWW目录
cp -R htdocs /data/www/wwwroot
cd /data/www/wwwroot/htdocs
cp config.example.php config.php
在文件末尾添加:
$_SERVER["PHP_AUTH_USER"] = "xcache";
$_SERVER["PHP_AUTH_PW"] = "password";
打开浏览器访问http://10.0.0.17/htdocs,输入帐号xcache 密码password 进入