Error Fixed : Error Establishing a Redis Connection to Disable Redis

To disable Redis when encountering an “Error establishing a Redis connection,” particularly in a WordPress environment, the primary method involves removing the object-cache.php file.

If you’re seeing an “Error establishing a Redis connection” (often in web apps or WordPress), it typically means your application is trying to use Redis but:

  • Redis isn’t running

  • The connection settings (host/port/password) are wrong

  • Redis is misconfigured or unreachable

If you want to disable Redis, here’s how to do that, depending on your setup:


🔧 1. Disable Redis in WordPress

If you’re using Redis for object caching (via a plugin like Redis Object Cache), follow these steps:

✅ Option A: Via WordPress Admin

  1. Go to WP Admin → Settings → Redis

  2. Click Disable Object Cache

✅ Option B: Manually via wp-config.php

Edit your wp-config.php and comment out or remove Redis-related lines like:

define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_CACHE', true);

Also remove or disable any Redis-related plugins from wp-content/plugins/.

Also Read : Error Fixed : The Media you are Trying to Play is not yet Cached on the Debrid Service


🔧 2. Disable Redis in Laravel / PHP apps

If you’re using Redis as a cache or queue backend (Laravel, Symfony, etc.):

Laravel

Edit your .env file and change:

CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file

That switches from Redis to file-based or local drivers.


🔧 3. Stop Redis Service (Linux Server)

If Redis is running but not needed:

sudo systemctl stop redis
sudo systemctl disable redis

Or, if you’re using redis-server manually:

pkill redis-server

🔧 4. Docker Users

If Redis runs in Docker, stop/remove the Redis container:

docker stop redis
docker rm redis

Or remove it from your docker-compose.yml.


🧼 5. Clear Redis Cache (Optional)

If you’re disabling Redis and want to clean old cached data:

redis-cli flushall

(Only run this if you’re sure no other apps are using the same Redis instance.)


Steps to Disable Redis (primarily for WordPress):

1. Access your WordPress installation directory:

  • Use an FTP client or your hosting provider’s file manager to connect to your website’s server.

2. Navigate to the wp-content directory:

  • This directory typically contains plugins, themes, and other site-specific content.

3. Locate and delete object-cache.php:

  • Find the file named object-cache.php within the /wp-content/ directory. This file is responsible for integrating Redis as an object cache in WordPress. Deleting it will effectively disable Redis caching for your site.

❓ Still Seeing the Error?

If the error persists even after disabling Redis, the app may be hardcoded to require it. In that case, you’d need to:

  • Remove Redis integration code

  • Modify config files

  • Revert to default caching system

Be the first to comment

Leave a Reply