First, install the XCache
# wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz
# tar ZXVF xcache-1.3.0.tar.gz
# CD xcache-1.3.0
#/usr/local/php/bin/phpize
#./configure--enable-xcache--enable-xcache-coverager--enable-xcache-optimizer--with-php-config=/usr/local/php/ Bin/php-config
# make && make install Note:
--enable-xcache means enable xcache support;
The--enable-xcache-coverager represents an additional feature for measuring the efficacy of the accelerator;
--enable-xcache-optimizer means that opcode optimization is enabled
After installation, the system will prompt xcache.so module generation path, this generation path is/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/, and then move xcache.so to/ The Usr/local/php/include/php/ext directory. Second, configuration management Xcache1, modify the PHP configuration file configuration, we can refer to XCache configuration template Xcache.ini, this file is located in the XCache Setup program # Vi/usr/local/php/lib/php.ini Then add the following content Extension_dir=/usr/local/php/include/php/ext
[Xcache-common]
Extension = xcache.so
[Xcache.admin]
Xcache.admin.enable_auth = On
Xcache.admin.user = "XCache"
Xcache.admin.pass = ""
[XCache]
Xcache.shm_scheme = "Mmap"
xcache.size=60m
Xcache.count =1
Xcache.slots =8k
Xcache.ttl=0
Xcache.gc_interval =0
xcache.var_size=4m
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 = On
Xcache.mmap_path = "/tmp/xcache"
Xcache.coredump_directory = ""
Xcache.cacher =on
Xcache.stat=on
Xcache.optimizer =off
[Xcache.coverager]
Xcache.coverager =on
Xcache.coveragedump_directory = "" 2, generate XCache cache file # touch/tmp/xcache# chmod 777/tmp/xcache3, generate XCache Administrator's Secret (MD5 ciphertext) # Echo-n "123456" | md5sume10adc3949ba59abbe56e057f20f883e then paste the generated MD5 ciphertext into the php.ini file Xcache.admin.pass = "" option, xcache.admin.pass= " e10adc3949ba59abbe56e057f20f883e "4, copy XCache management program to the Web site root directory
# cp-a/tmp/xcache-1.3.0/admin//usr/local/nginx/html/then restart PHP and then Access http://localhost/admin, username xcache password is 123456; , you can also use Phpinfo to verify that PHP supports XCache
Use and configuration of XCache