GICT knowledge base
What is Xcache and how to install Xcache
Published
How to install Xcache?
Xcache is a php accelerator. As of this writing the current version is 3.2.0. Check https://xcache.lighttpd.net for the latest version before beginning.
Xcache will not accelerate php running as a CGI, such as SUPHP. However it still could be used by some caching plugins, some that come with wordpress, to use caching. Xcache will accelerate mod_ruid2, (or any php as a dso), and php-fpm. Litespeed, provided on InterServer Shared Hosting also supports xcache even running with php suexec.
To begin, log into ssh.
wget https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz tar -zxvf xcache-3.2.0.tar.gz cd xcache-3.2.0 phpize ./configure --enable-xcache make
non root user?
sudo make install
root user?
make install
Now edit the PHP.ini file. The location can vary. Common locations are /usr/local/lib/php.ini
extension="xcache.so" ; ini only settings, all the values here is default unless explained ; select low level shm/allocator scheme implemenation xcache.shm_scheme = "mmap" ; to disable: xcache.size=0 ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows xcache.size = 64M ; set to cpu count (cat /proc/cpuinfo |grep -c processor) xcache.count = 2 ; just a hash hints, you can always store count(items) > slots xcache.slots = 8k ; ttl of the cache item, 0=forever xcache.ttl = 0 ; interval of gc scanning expired items, 0=no scan, other values is in seconds ; same as aboves but for variable cache xcache.var_size = 100M xcache.var_count = 1 xcache.var_slots = 8K ; default ttl xcache.var_ttl = 0 xcache.var_maxttl = 0 xcache.var_gc_interval = 300 xcache.test = Off ; N/A for /dev/zero xcache.readonly_protection = Off ; for *nix, xcache.mmap_path is a file path, not directory. ; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection ; 2 group of php won't share the same /tmp/xcache ; leave it blank(disabled) or "/tmp/phpcore/" ; make sure it's writable by php (without checking open_basedir) xcache.coredump_directory = "" ; per request settings xcache.cacher = On xcache.stat = On xcache.optimizer = On [xcache.coverager] ; per request settings ; enable coverage data collecting for xcache.coveragedump_directory and xcache_$ xcache.coverager = Off ; ini only settings ; make sure it's readable (care open_basedir) by coverage viewer script ; requires xcache.coverager=On xcache.coveragedump_directory = ""
When done restart apache
Related guides
How to Increase PHP Upload Max Filesize on Apache and Nginx
Learn how to increase PHP upload max filesize on Apache and Nginx, including configuration settings, common issues, and approaches for handling large file uploads.
PHPHow TO: Debugging 500 errors on zencart
Troubleshooting Your Zen Cart: A Quick Guide to Debugging Running an e-commerce site on InterServer’s high-performance hosting gives you a great head start, but even the...
PHPPHP Versions on cPanel: Everything You Need to Know
PHP Versions on cPanel: Everything You Need to Know If you are running a PHP site here at InterServer, you have probably seen notifications in your dashboard talking...
PHPHow to Install or Upgrade to PHP8.4 in Ubuntu
Upgrade to PHP 8.4 on Ubuntu 24.04 for real-world speed boosts, better error handling, and smoother Laravel, WordPress, and Symfony support.
