Integrating XCache Into PHP5 And Lighttpd (OpenSUSE 11.2)
|
Submitted by falko (Contact Author) (Forums) on Mon, 2010-08-09 16:59. :: SuSE | Web Server | Lighttpd
Integrating XCache Into PHP5 And Lighttpd (OpenSUSE 11.2)Version 1.0 This guide explains how to integrate XCache into PHP5 and lighttpd on an OpenSUSE 11.2 system. 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 an OpenSUSE 11.2 server with the IP address 192.168.0.100 where lighttpd and PHP5 are already installed and working (e.g. as shown in this tutorial: Installing Lighttpd With PHP5 And MySQL Support On OpenSUSE 11.2). I'll use lighttpd's default document root /srv/www/htdocs 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 /srv/www/htdocs: vi /srv/www/htdocs/info.php
Afterwards, we call that file in a browser: http://192.168.0.100/info.php As you see, we have PHP 5.3.2 installed... ... but XCache isn't mentioned anywhere on the page:
3 Installing XCacheUnfortunately XCache isn't available as an rpm package for OpenSUSE 11.2, therefore we have to build it from the sources. First we install all packages that we need to build XCache: yast2 -i gcc flex wget gcc-c++ make php5-devel Next we download and uncompress the latest XCache version: cd /tmp Then we go to the new XCache source directory... cd xcache-1.3.0 ... and build XCache as follows: phpize Next we copy xcache.ini to the /etc/php5/conf.d directory: cp xcache.ini /etc/php5/conf.d Now we must configure XCache. The configuration options are explained here: http://xcache.lighttpd.net/wiki/XcacheIni. The least you should do is enable extension = xcache.so and disable all zend_extension lines; furthermore, set xcache.size to a size (in MB) > 0 to enable XCache: vi /etc/php5/conf.d/xcache.ini
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:
4 Links
|








Recent comments
10 hours 48 min ago
17 hours 29 min ago
21 hours 20 min ago
22 hours 58 min ago
1 day 7 hours ago
1 day 16 hours ago
1 day 17 hours ago
1 day 21 hours ago
2 days 1 hour ago
2 days 2 hours ago