If you are looking for a caching solution to speed up the website performance, XCache is one of the best options.
What is XCache, and what are its uses?
1. XCache accelerates the performance of PHP on servers by speeding up page loading.
2. XCache optimizes performance by eliminating the compilation time of PHP scripts by caching the compiled state of PHP scripts into the RAM and using the compiled version straight from the RAM.
3. This will increase the page generation time up to 5 times as it also optimizes many other aspects of PHP scripts and reduces server load.
How to Enable XCache via SSH
1. Download the XCache
2. For Linux VPS, you can log in to your server via SSH and execute the following commands for XCache installation –
# wget xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz
[this line will download the XCACHE]
# tar -zxvf xcache-3.1.0.tar.gz [this line will extract the file]
# cd xcache-3.1.0
# phpize
# ./configure –enable-xcache
# make
# make install
3. Now, add the following extension in the php.ini file –
extension=xcache.so
4. Restart Apache
How to Enable XCache from WHM/ cPanel?
1. Log in to your WHM.
2. Go to EasyApache from the left-hand pane options.
3. Keep the previously saved config option selected and click on Start Customizing based on the profile.
4. Do not change anything in Apache and PHP.
Simply click on the Next button to go to the next steps.
5. You will have an option XCache for PHP from the Short Option list.
Select this option and click on Save and Build.
6. It will take a few minutes to complete the Build process.
Once done, restart Apache from WHM.
7. You can modify the values set for XCache from the php.ini file.
Following are the recommended settings for XCache; however, you can modify them as per your requirements.
XCache Administration Settings –
xcache.admin.user="mOo"
xcache.admin.pass=""
xcache.admin.enable_auth="on"
xcache.test="Off"
xcache.coredump_directory=""
xcache.disable_on_crash="off"
XCache Cacher Settings –
xcache.cacher="On"
xcache.stat=“On”
xcache.shm_scheme="mmap"
xcache.readonly_protection=Off
xcache.size="50M"
xcache.count="1"
xcache.slots="8K"
xcache.ttl="3600"
xcache.gc_interval="300"
xcache.var_size="16M"
xcache.var_count="2"
xcache.var_slots="8K"
xcache.var_ttl="3600"
xcache.var_maxttl="7200"
xcache.var_gc_interval="300"
xcache.mmap_path="/dev/zero"
xcache.readonly_protection="Off"
XCache Optimizer Settings:
xcache.optimizer="On"
XCache Coverager Settings –
xcache.coverager="Off"
xcache.coverager_autostart=”Off”
xcache.coveragedump_directory="/tmp/pcov/"
You can verify the installed XCache and its settings by uploading a simple phpinfo() page.