Integrating XCache Into PHP5 (Debian Etch & lighttpd)
Integrating XCache Into PHP5 (Debian Etch & lighttpd)Version 1.0 This guide explains how to integrate XCache into PHP5 on a Debian Etch system (with lighttpd). From the XCache project page: "XCache is a fast, stable PHP opcode cacher that has been tested and is now running on production servers under high load." It's similar to other PHP opcode cachers, such as eAccelerator and APC. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI have tested this on a Debian Etch server with the IP address 192.168.0.100 where lighttpd and PHP5 are already installed and working. I'll use lighttpd's default document root /var/www in this tutorial for demonstration purposes. Of course, you can use any other vhost as well, but you might have to adjust the path to the info.php file that I'm using in this tutorial.
2 Checking PHP5's Current StateFirst, before we install XCache, let's find out about our PHP5 installation. To do this, we create the file info.php in our document root /var/www: vi /var/www/info.php
Afterwards, we call that file in a browser: http://192.168.0.100/info.php As you see, we have PHP 5.2.0 installed... ... but XCache isn't mentioned anywhere on the page:
3 Installing XCacheUnfortunately XCache is available as a Debian package only for Debian Lenny (testing) and Sid (unstable), but not for Etch. Therefore we will install the XCache package from Lenny. To do this, open /etc/apt/sources.list and add the line deb http://ftp2.de.debian.org/debian/ lenny main; your /etc/apt/sources.list could then look like this: vi /etc/apt/sources.list
Of course (in order not to mess up our system), we want to install packages from Lenny only if there's no appropriate package from Etch - if there are packages from Etch and Lenny, we want to install the one from Etch. To do this, we give packages from Etch a higher priority in /etc/apt/preferences: vi /etc/apt/preferences
(The terms etch and lenny refer to the appropriate terms in /etc/apt/sources.list; if you're using stable and testing there, you must use stable and testing instead of etch and lenny in /etc/apt/preferences as well.) Afterwards, we update our packages database: apt-get update ... upgrade the installed packages: apt-get upgrade (You might see the following question: Do you want to upgrade glibc now? [Y/n] <-- Y ) ...and install php5-xcache: apt-get install php5-xcache That's it. Restart lighttpd, and you're done: /etc/init.d/lighttpd restart Afterwards, open info.php again in a browser: http://192.168.0.100/info.php You should now see XCache mentioned on the page which means it has successfully been integrated and is working as expected: If you want to change the XCache configuration, you can do so by editing /etc/php5/cgi/conf.d/xcache.ini. Don't forget to restart lighttpd afterwards. The configuration options are explained here: http://xcache.lighttpd.net/wiki/XcacheIni
4 Links
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com











Recent comments
19 hours 20 min ago
20 hours 49 min ago
1 day 23 min ago
1 day 3 hours ago
1 day 6 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 8 hours ago
1 day 9 hours ago
1 day 9 hours ago