Skip to main content
added an explicit question
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Can't connect How do I set up a site to use Redis as cache handler?

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: are the following.

  1. Edited config.yml

    I edited the config.yml file to add the following lines

    installed_extras:
      - redis
      - php-redis
    
  2. I enabled the Redis module

  3. I edited the settings.php file to add the following lines

    $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';
    

installed_extras:
  - 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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
//Cache miss
if ($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
} 
else {
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it.
echo $cache;
exit();

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

How do I set up Drupal to use Redis as cache handler?

Can't connect to Redis

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

installed_extras:
  - 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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
//Cache miss
if($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
}else{
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it
echo $cache;
exit();

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

How do I set up a site to use Redis as cache handler?

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 are the following.

  1. I edited the config.yml file to add the following lines

    installed_extras:
      - redis
      - php-redis
    
  2. I enabled the Redis module

  3. I edited the settings.php file to add the following lines

    $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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
if ($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
} 
else {
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it.
echo $cache;
exit();

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

How do I set up Drupal to use Redis as cache handler?

added 12 characters in body
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

Can't connect to PHP-RedisRedis

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

    installed_extras:

    • redis
    • php-redis
  2. Enabled the Redis module

  3. Edit settings.php 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';

    Edited config.yml

installed_extras:
  - 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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
//Cache miss
if($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
}else{
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it
echo $cache;
exit();

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

Can't connect to PHP-Redis

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

    installed_extras:

    • redis
    • php-redis
  2. Enabled the Redis module

  3. Edit settings.php 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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
//Cache miss
if($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
}else{
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it
echo $cache;
exit();

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

Can't connect to Redis

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

installed_extras:
  - 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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
//Cache miss
if($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
}else{
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it
echo $cache;
exit();

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

deleted 52 characters in body
Source Link

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

    installed_extras:

    • redis
    • php-redis
  2. Enabled the Redis module

  3. Edit settings.php 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';

    $settings['cache_prefix']['default'] = 'azg_';

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

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

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

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

    installed_extras:

    • redis
    • php-redis
  2. Enabled the Redis module

  3. Edit settings.php 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';

    $settings['cache_prefix']['default'] = 'azg_';

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

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

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

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

    installed_extras:

    • redis
    • php-redis
  2. Enabled the Redis module

  3. Edit settings.php 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();
$redis->connect('127.0.0.1');
$cache = $redis->get('key');
//Cache miss
if($cache === false) {
  echo "miss";
  $cache = "test";
  $redis->set('key',$cache);
}else{
  echo "didn't miss";
}
// At this point $cache is either the retrieved cache or a fresh copy, so echo it
echo $cache;
exit();

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

Source Link
Loading