Learn how to disable memcache Drupal 7 cleanly. Clear cache, remove settings, and stop unwanted server connection errors. Our Drupal Support Team is a;ways here to help you.
How to Disable Memcache in Drupal 7 the Right Way
Many Drupal 7 websites rely on Memcache to boost speed in production. But on local or development environments, it often causes headaches. Pages don’t refresh as expected, changes remain hidden, and in some cases you’ll even see repeated connection errors. If you’ve inherited a Drupal 7 site where Memcache is not required, you may want to disable it completely. Let’s walk through how to disable memcache Drupal 7 without breaking the site.
An Overview
Why Memcache Can Be a Problem in Development
The main purpose of Memcache is performance. However, in development, it can block you from seeing real-time updates. Worse, if Memcache is enabled but not properly installed on the server, you may run into log messages like:
Failed to connect to memcache server: 127.0.0.1:11211
This error often shows up every couple of minutes, creating unnecessary noise. Clearing Drupal cache or restarting Apache does not solve it. To properly disable it, you must adjust both modules and configuration.
Configuration Entries You Might See
Often, the settings.php file includes lines such as:
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['cache_default_class'] = 'MemCacheDrupal';
These entries connect Drupal to Memcache. If you simply delete them, the site may stop working. That’s why the right approach matters.
How to Properly Disable Memcache in Drupal 7
To get rid of the issue once and for all, you need to follow this process carefully, starting with a proper backup:
1. Disable and uninstall the Memcache module.
You can do this either via the Drupal admin panel or by running the Drush command.
drush dis memcache
When prompted, you’ll see:
The following extensions will be disabled: memcache
Do you really want to continue? (y/n): y
Confirm with “y” to proceed.
2. Remove module entries from settings.php.
Delete or comment out the lines that reference the Memcache backend and classes. These include the exact codes mentioned above.
3. Delete the Memcache module folder.
Go to sites/all/modules/contrib/ and remove the memcache folder. This ensures Drupal won’t look for it again.
4. Clear Drupal cache tables.
After making changes, clear the cache completely. Make sure all cache tables in the database are empty. This step prevents Drupal from trying to reference old configurations.
By following this flow, you disable it without errors, while keeping your site stable.
[If needed, Our team is available 24/7 for additional assistance.]
Conclusion
Memcache is excellent for production, but it becomes a nuisance on local environments. Instead of living with endless log errors, it’s better to fully disabling it. By uninstalling the module, removing code entries, deleting the folder, and clearing the cache, you regain a clean environment where every change is visible instantly.
0 Comments