Running a caching solution on your VPS or dedicated server can squeeze a few extra users on it before you’ll have to upgrade to more expensive hardware, and should reduce load times for visitors. A total win-win situation for all involved.

{code type=code}wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
tar -zxf xcac-*.tar.gz
cd xcache
phpize
./configure –enable-xcache
make
make install
cat xcache.ini >> /etc/php.ini
{/code}

Line 1. This gets the xcache files needed for install. Currently at version 1.2.2
Line 2. This untars the package
Line 3. Switches you to the xCache directory
Line 4. Lets you install xCache without recompiling php
Line 5. Sets configuration options
Line 6. Prepares it for install
Line 7. Installs
Line 8. Adds the default xCache configuration options to your php.ini file. (Note: If your php.ini file is in a different location do a ‘locate php.ini’ to find it)

After you’ve installed it you’ll need to change php.ini to ensure everything is okay.

{code type=code}nano /etc/php.ini{/code}

Make sure that ‘zend_extension=../../xcache.so’ appears before all other ‘zend_extension=….’ or else you’ll have problems.

Just for good measure, restart php and apache to ensure nothing fails. Enjoy your new optimized caching server!

Related Articles

Leave a comment

Your email address will not be published. Required fields are marked *