How to install xcache

Posted at December 22, 2015 at 2:13 pm by John Quaglieri

Xcache is a php accelerator.  As of this writing the current version is 3.2.0. Check 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.

tar -zxvf xcache-3.2.0.tar.gz
cd xcache-3.2.0
./configure --enable-xcache

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

; 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

; 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

0.00 avg. rating (0% score) - 0 votes

You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply