1. Install Xcache
Copy codeThe Code is as follows:
# 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-coverager -- enable-xcache-optimizer -- with-php-config =/usr/local/php/bin/php-config
# Make & make install
Note:
-- Enable-xcache indicates that Xcache support is enabled;
-- Enable-xcache-coverager indicates additional features used to measure accelerator efficacy;
-- Enable-xcache-optimizer indicates that the operation code optimization is enabled.
After the installation is complete, the system prompts xcache. so module generated path, this generated path for/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/, and then xcache. so move to the/usr/local/php/include/php/ext directory.
Ii. configure and manage Xcache
1. Modify the php configuration file
During configuration, refer to the xcache configuration template xcache. ini, which is located in the Xcache installer.
# Vi/usr/local/php/lib/php. ini
Then add the following content:
Copy codeThe Code is as follows:
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 = 60 M
Xcache. count = 1
Xcache. slots = 8 K
Xcache. ttl = 0
Xcache. gc_interval = 0
Xcache. var_size = 4 M
Xcache. var_count = 1
Xcache. var_slots = 8 K
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 files
# Touch/tmp/xcache
# Chmod 777/tmp/xcache
3. Generate the Xcache administrator secret (MD5 ciphertext)
# Echo-n" 123456 "| md5sum
E10adc3949ba59abbe56e057f20f883e
Then paste the generated MD5 ciphertext into the php. ini file xcache. admin. pass = "" option, xcache. admin. pass = "e10adc3949ba59abbe56e057f20f883e"
4. Copy the Xcache hypervisor to the root directory of the website.
Copy codeThe Code is as follows:
# Cp-a/tmp/xcache-1.3.0/admin // usr/local/nginx/html/
Restart PHP and access http: // localhost/admin. the user name is xcache and the password is 123456. In addition, you can verify whether PHP supports Xcache through phpinfo.