Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Install XCache for PHP  (Read 2101 times)

0 Members and 1 Guest are viewing this topic.

Vinil

  • Guest
How to Install XCache for PHP
« on: December 23, 2013, 08:37:34 pm »
XCache is a open-source opcode cacher, which means that it accelerates the performance of PHP on servers. It optimizes performance by removing the compilation time of PHP scripts by caching the compiled state of PHP scripts into the shm (RAM) and uses the compiled version straight from the RAM. This will increase the rate of page generation time by up to 5 times as it also optimizes many other aspects of php scripts and reduces serverload.

To install download the latest Stable xcache Release

Code: [Select]
cd /usr/local/src/
wget http://xcache.lighttpd.net/pub/Releases/3.0.3/xcache-3.0.3.tar.gz
tar -zxvf xcache-3.0.3.tar.gz
cd xcache-3.0.3

Use phpize command to prepare xcache as a PHP extension for compiling,

phpize

Configure, compile and install xcache

./configure –enable-xcache
make
make install


After successful installation open php.ini and add xcache.so entries.

Code: [Select]
vi /usr/local/lib/php.ini
extension=”xcache.so”

restart Apache webserver.

/etc/init.d/httpd restart


Now verify the xcache by checking the php version from CLI or use an info page

Quote
root@server [/]# php -v
PHP 5.3.25 (cli) (built: Jul  9 2013 23:42:49)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with XCache v3.0.3, Copyright (c) 2005-2013, by mOo
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with XCache Cacher v3.0.3, Copyright (c) 2005-2013, by mOo
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH