Memcache on Ubuntu 14.04 for Drupal 7

Last modified
Sunday, February 5, 2017 - 21:23

On this post I'll show you some quick steps to install and configure Memcache on Ubuntu 14.04 so you can enable Memcache on your Drupal installation.

First, you need to get some necessary packages from the Ubuntu repository, on a terminal window type:

# sudo apt-get install memcached php5-memcache

This will install the Memcache Server deamon and the PHP Memcache Extension.

Then, on your settings.php file you will need to add this lines in order to activate the Memcache Drupal module, see the module's documentation for more information about extend your memcache functionality.

$conf['cache_backends'][] = 'sites/all/modules/memcache/';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['memcache_servers'] = array('localhost:11211' => 'default');
$conf['memcache_key_prefix'] = 'my_site_prefix';

That's pretty much it!, easy, right? To make sure memcache is working on your site, visit the Status Report Page and you should see the Memcache Information box there as the following screenshots shows:

Add new comment

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.