I'm trying to enable Redis on my Drupal site but when I check the status of the module I keep getting this warning message:

No Redis client connected, this module is useless thereof. Ensure that you enabled module using it or disable it.

The steps I followed to enable Redis:

  1. Edited config.yml

  - redis
  - php-redis

  1. Enabled the Redis module

  2. Edit settings.php and added the following settings:

$settings['cache']['default'] = 'cache.backend.redis';

$settings['redis.connection']['interface'] = 'PhpRedis';

$settings['container_yamls'][] = 'modules/redis/example.services.yml';

$settings['container_yamls'][] = 'modules/redis/redis.services.yml';

I also tried to execute the following code in index.php and the cache appears to be working:

$redis = new Redis();
$cache = $redis->get('key');
//Cache miss
if($cache === false) {
  echo "miss";
  $cache = "test";
  echo "didn't miss";
// At this point $cache is either the retrieved cache or a fresh copy, so echo it
echo $cache;

So it appears that Redis is working but for some reason it isn't used by Drupal.


For Drupal 8, use this code in the settings.php file:

$settings['redis.connection']['host'] = 'localhost';
$settings['redis.connection']['port'] = NULL;
$settings['cache']['default'] = 'cache.backend.redis';
$settings['redis.connection']['base'] = 101;

You can check whether or not Redis is running by viewing the status report at: /admin/reports/status

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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