Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have installed memcached, but I'm stuck now with how to implement it in conjunction with Drupal. I've already installed and enabled the Drupal memcache module, but nobody seems to be able to offer clear instructions on how to edit settings.php. As the following is the least complicated I've chosen it, but I don't know what they mean by "own unique key prefix"; where am I supposed to find this? I don't seem to need RPM to make it work because I had that as well but removed it and memcached still works, so what is the deal with that on CentOS 6.3?

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_key_prefix'] = 'something_unique';
// note : Replace the "something_unique" in the last line with your own unique memcache key prefix.
share|improve this question
Migrate to Stack Overflow? – Christopher Jan 13 at 18:52

migrated from unix.stackexchange.com Jan 14 at 8:32

1 Answer

The Drupal documentation covers this.

Prefixing

If you want to have multiple Drupal installations share memcached instances, you need to include a unique prefix for each Drupal installation in the $confarray of settings.php.

<?php
$conf['memcache_key_prefix'] = 'something_unique';
?>
share|improve this answer
So just leave it out if you have only one instance? and do you have to have rpm set up? – freja Jan 14 at 6:24
I have one instance but in a subfolder so does that require a unique prefix and where is that prefix called? Is it the prefix of the drupal folder- not clear to me at all. – freja Jan 14 at 6:26
You can make it whatever you want, but it has to be present. And you should reinstall memcached; if you deleted it, then it won't be there anymore as soon as the service stops. – Michael Hampton Jan 14 at 6:28
I don't know what it is, is it something you add to a database table in mysql? – freja Jan 14 at 6:42
You don't know what what is? – Michael Hampton Jan 14 at 6:44
show 7 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.