I've inherited a site that connected with memcache even though its not necessary and its not installed on the server. Although I've disabled the memcache module, the settings file has these lines which I cannot delete or the site stops working:

$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['cache_default_class'] = 'MemCacheDrupal';

I am getting this log message every two or three minutes:

Failed to connect to memcache server:

Clearing the Drupal cache and restarting Apache do not seem to fix the problem. How can I fix this?

  • 2
    Can you elaborate on how the site stops working when you remove those lines? Did you do a cache clear after you removed them?
    – mpdonadio
    Commented Aug 27, 2015 at 22:42
  • I get a lot of strange messages for example Notice: Undefined index: schema_fields_sql in /usr/local/data/www/docs/includes/entity.inc on line 298 Catchable fatal error: Argument 2 passed to SelectQuery::fields() must be of the type array, null given, called in /usr/local/data/www/docs/includes/entity.inc on line 317 and defined in /usr/local/data/www/docs/includes/database/select.inc on line 1301
    – Diana
    Commented Aug 28, 2015 at 14:23
  • yes I did clear the cache
    – Diana
    Commented Aug 28, 2015 at 14:23
  • tried to run update, get this error Fatal error: Class 'SearchQuery' not found in /usr/local/data/www/docs/sites/all/modules/contrib/views/modules/search/views_handler_filter_search.inc on line 201
    – Diana
    Commented Aug 28, 2015 at 14:24
  • Did you restart Apache? It really sounds like you have APC problems.
    – mpdonadio
    Commented Aug 28, 2015 at 14:28

1 Answer 1


Hi You have to follow below steps in order:

  1. disable and uninstall module.
  2. remove from settings.php and delete folder of module.
  3. clear cache (make sure all tables are empty)

For users using drush:

drush dis memcache

The following extensions will be disabled: memcache
Do you really want to continue? (y/n): y


  • I think you've failed to mention the module name Memcache (memcache) which is the one she needs to disable.
    – Beebee
    Commented Aug 28, 2015 at 10:49
  • Thanks for making it more easy by writing name of module :)
    – jas
    Commented Aug 28, 2015 at 10:51
  • Why is a cron run needed?
    – mpdonadio
    Commented Aug 28, 2015 at 14:25
  • 2
    I had to use drush cc clear all for this to work. just clearing the cache from the admin page didnt work.
    – Diana
    Commented Nov 17, 2015 at 21:55
  • Please mention Drupal major version.
    – Pupil
    Commented Apr 25, 2019 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.