Outils personnels
Vous êtes ici : Accueil GNU / Linux Debian Installer XCache sur Debian 4.0 Etch et 5.0 Lenny
Actions sur le document
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Install XCache on Debian 4.0 Etch

Par Pierre-Yves Landuré - Dernière modification 19/12/2012 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!

Posté par DanielS le 29/08/2008 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!

Posté par Orlando Agostinho le 16/12/2008 10:44
Hi,

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

Marvelous tutorial

Posté par Fedir le 17/11/2011 16:59
Just perfect, thank You very much !

BlogBang
Navigation
 

Réalisé avec Plone

Ce site respecte les normes suivantes :

Wikio