Table of Contents
Was this article helpful?
Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles.

How To Install XCache on Ubuntu 15.04

Last Updated: Sat, Oct 17, 2015
Linux Guides PHP Ubuntu Web Servers
Archived content

This article is outdated and may not work correctly for current operating systems or software.

XCache is an open-source opcode cacher for PHP. In this tutorial, I'll explain how to install and configure XCache. I assume that you already have a web server with Apache and PHP installed.

Step 1: Installing XCache

You can install XCache with apt-get:

apt-get install php5-xcache

Step 2: Changing settings

Change your XCache settings to make it function properly. Open the following file with your favorite text editor:


If this file does not exist, try opening the following file:


You can find all settings and their functions on the official XCache website.

Step 3: Verifying XCache installation

To verify that XCache has successfully been installed, execute:

php -v

You should see that XCache is now being used by PHP:

with XCache v3.1.0, Copyright (c) 2005-2013, by mOo

with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo

with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo

with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo

Step 4: Enabling the XCache control panel

XCache features a built-in web-based control panel. In order to be able to access it, we need to generate an md5-encrypted password. We can do this by executing:

echo -n "password" | md5sum

Replace password with the password you'd like to use.

Copy the md5-encrypted password, and open the XCache configuration file from step 2.

Find the [xcache.admin] sections and remove the comments. Change the value of xcache.admin.pass to your md5-encrypted password which you just generated.

Next, copy the /usr/share/xcache/htdocs folder to a folder accessible from the web. You can now login to the XCache web-based control panel!

Step 5: Restarting Apache

Finally, restart Apache. After it restarts, XCache will be fully functional:

service apache2 restart

Want to contribute?

You could earn up to $600 by adding new articles.