Install XCache on Debian 4.0 Etch
XCache is a tool allowing to speed up your PHP scripts execution. It's a good alternative to APC (Alternative PHP Cache) if you are using Lighttpd. This page help you to install it on Debian 4.0 Etch.
This howto is obsolete. A new version is available on the Biapy Help Desk
Install the PHP extension XCache on Debian
Install
First, install the tools needed to build XCache:
/usr/bin/apt-get install php5-dev make
Set the version of XCache you want to install:
VERSION=1.3.0
You can now download the XCache sources:
/usr/bin/wget http://xcache.lighttpd.net/pub/Releases/$VERSION/xcache-$VERSION.tar.gz \ --output-document=/tmp/xcache-$VERSION.tar.gz
Extract the contents of the archive:
/bin/tar --directory=/tmp -xzf /tmp/xcache-$VERSION.tar.gz
And go to the created folder:
cd /tmp/xcache-$VERSION
You can now build XCache:
/usr/bin/phpize --clean /usr/bin/phpize ./configure --enable-xcache /usr/bin/make /usr/bin/make install
Once the build is done without errors, configure PHP to use XCache:
/bin/cp /tmp/xcache-$VERSION/xcache.ini /etc/php5/conf.d/xcache.ini /bin/sed -i -e 's/^zend_extension_ts.*/; \0/' \ -e 's/^\(zend_extension =\).*/\1 \/usr\/lib\/php5\/20060613+lfs\/xcache.so/' \ /etc/php5/conf.d/xcache.ini
And setup the amount of memory you want to use for cache:
/bin/sed -i -e 's/^\(xcache\.size[ ]*=\).*/\1 64M/' \ -e 's/^\(xcache\.var_size[ ]*=\).*/\1 64M/' \ /etc/php5/conf.d/xcache.ini
Note: If you plan to use XCache with Symfony, you need to disable the admin authentification in order to allow your symfony code to use the xcache_count function:
/bin/sed -i -e 's/^\(xcache\.admin\.enable_auth[ ]*=\).*/\1 Off/' \ /etc/php5/conf.d/xcache.ini
And restart your HTTP server:
- For Apache 2:
/etc/init.d/apache2 force-reload
- For Lighttpd:
/etc/init.d/lighttpd force-reload
Thanks
- Thanks to XCache devellopers.
Congratulations!
Thanks so much! Really! this site was very usefully!
Perfect Every Time!
Every one of these works perfect and it's such a blessing to have found this site!
I've added you to stumbleupon as I think everyone looking for help needs to at least see this once!