[cc lang=”bash”]apt-get install autoconf make
cd /tmp
wget http://xcache.lighttpd.net/pub/Releases/1.3.1/xcache-1.3.1.tar.gz
tar -xvf xcache-1.3.1.tar.gz[/cc]
[cc lang=”bash”]cd xcache-1.3.1
phpize
./configure –enable-xcache
make
make install[/cc]

Notice this line:
“Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/”

Now run and you will see number of physical processors in the server:
[cc lang=”bash”]grep “^physical is” /proc/cpuinfo | awk ‘{print $NF}’ | uniq | wc -l 1[/cc]
now
[cc lang=”bash”]nano -w /usr/local/lib/php.ini[/cc]
so you won’t create a xcache.ini

[cc lang=”bash”][xcache-common]
;; install as zend extension (recommended), normally “$extension_dir/xcache.so”
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
zend_extension_ts = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
;; For windows users, replace xcache.so with php_xcache.dll
;zend_extension_ts = c:/php/extensions/php_xcache.dll
;; or install as extension, make sure your extension_dir setting is correct
; extension = xcache.so
;; or win32:
; extension = php_xcache.dll
[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = “mOo”
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = “”

[xcache]
xcache.shm_scheme = “mmap”
xcache.size = 60M
xcache.count = 1 //nr of proc
xcache.slots = 8K
xcache.ttl = 3600
xcache.gc_interval = 300

; Same as aboves but for variable cache
; If you don’t know for sure that you need this, you probably don’t
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

; N/A for /dev/zero
xcache.readonly_protection = Off

xcache.mmap_path = “/dev/zero”

xcache.cacher = On
xcache.stat = On[/cc]

[xcache-common] and its content must come before [Zend] or else!
[cc lang=”bash”]/etc/init.d/httpd restart
php -v[/cc]
to see if everything is ok
[cc lang=”bash”]touch phpinfo.php
nano phpinfo.php[/cc]
copy paste the code to phpinfo.php
[cc lang=”php”][/cc]

Run it in a browser. You should see xcache is installed.

This tutorial assumes you are not a complete moron.