Personal tools
You are here: Home GNU / Linux Debian 4.0 Etch Install XCache on Debian 4.0 Etch
Document Actions
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Install XCache on Debian 4.0 Etch

by Pierre-Yves Landuré last modified 2012-12-19 20:01

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

Perfect Every Time!

Posted by DanielS at 2008-08-29 06:41
Seriously,
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!

Congratulations!

Posted by Orlando Agostinho at 2008-12-16 10:44
Hi,

Thanks so much! Really! this site was very usefully!

Marvelous tutorial

Posted by Fedir at 2011-11-17 16:59
Just perfect, thank You very much !

BlogBang
Navigation
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards:

Wikio