The XCache – Simple way to install Xcache from source code

The XCache is useful when your websites have page load time issue. I think we all were faced/are facing the same problem while browsing high traffic websites most times. Here is the solution for that by caching the already executed files and and uses the executed one when we recall the same from browser again.

Introduction

XCache is a fast, stable ​PHP opcode cacher that has been proven and is now running on production servers under high load. It is tested (on linux) and supported on all of the latest ​PHP release branches such as PHP_5_1 PHP_5_2 PHP_5_3 PHP_5_4 PHP_5_5. ThreadSafe/Windows is also perfectly supported. XCache overcomes many of the problems found with other opcachers such as being able to run with new ​PHP versions.
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 server load.

How can enable Xcache in a cPanel server?

You can simply enable it by running easyapache.

Installation steps from source code.

1. You can download the source code from Here

wget http://xcache.lighttpd.net/pub/Releases/2.0.1/xcache-2.0.1.tar.gz

2. Extracting file.

tar -zxvf xcache-2.0.1.tar.gz

You will get more details about tar command usages from here >> tar command in Linux <<
3. change directory to xcache-2.0.1

cd xcache-2.0.1
phpize
./configure –enable-xcache
make
make install

Now edit php.ini and add following extension.

extension=xcache.so

Restart apache and you will see XCache enabled.

service httpd restart

How to check if XCache is installed or not in a server?

It is simple to find out if the Xcache is installed or not in the server. Here I am explaining some commandline usages to findout the same.

Option – I

php -m | grep -i xcache

Sample output:

# php -m|grep -i xcache
XCache
XCache Cacher
XCache Cacher

Option – II

php -v|grep -i xcache

Sample output:

# php -v|grep -i xcache
    with XCache v3.0.3, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.0.3, Copyright (c) 2005-2013, by mOo

Option – III
From phpinfo page, create a phpinfo.php page and check it from the browser.

<? phpinfo(); ?>

Thats it!

Related Links:
1, Install Memcached and memcache in a cPanel server.
2, How to disable phpinfo();
3, How to create phpinfo page.

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

2 thoughts on “The XCache – Simple way to install Xcache from source code

  1. Is this faster than Memcached and memcache? If so then i will switch from Memcache to XCache. Because last month i read about your Memcache installation process and installed in my server. So please clear my doubt. Please reply. Thank you.

Leave a Reply

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