How to configure Joomla! 2.5 to use Memcached

In this tutorial we will explain how to configure your Joomla! CMS application to use Memcached.

Joomla! natively supports Memcached.

This means that you just need to enable this option. In order to do this you have to edit the Joomla! PHP configuration file - configuration.php.

This file is stored inside the web root folder. For example, if your website is accessible at:

http://yourdomainname.com/joomla this means that the configuration.php file is in your public_html/joomla folder.

You can use the cPanel File Manager to edit the file.

You have to open the file and find the following two variables:

public $caching = '0';public $cache_handler = 'file';

Edit them and change the code to:

public $caching = '2';
public $cache_handler = 'memcache';
public $memcache_server_host = 'localhost';
public $memcache_server_port = '11211';

Please note that you should replace port number 11211 with the correct port number for your hosting account.

For more details how to find out the correct port please check the following tutorial:

Enable Memcached from cPanel

After that save the file. The following screenshot shows how to edit the file via the cPanel File Manager -> Code Editor Tool:

That's it - your Joomla! CMS is now correctly configured and it uses Memcached to cache API calls, database calls and objects.

If you access the Joomla! CMS administrative area you should be able to see the following settings under Site -> Global Configuration -> System tab: