Skip to content

Lando Redis Drupal 7

This configuration has been tested only local and works like a charm.

.lando.yml File Contents

name: drupal7-redis
recipe: drupal7
config:
  webroot: .
services:
  cache:
    type: redis:4.0
    portforward: 6380
    persist: true
  mailhog:
    type: mailhog
    hogfrom:
      - appserver
  pma:
    type: phpmyadmin
tooling:
  redis-cli:
    service: cache

settings.php File Contents

/**
 * Redis Configuration. Prod.
 *
 * For informational purposes.
 */
// Can be "Predis".
// $conf['redis_client_interface'] = 'Predis';
// Your Redis instance hostname.
// $conf['redis_client_host']       = '127.0.0.1';
// For multiple sites on same Redis instance, unique identifier.
// $conf['cache_prefix']['default'] = 'live_';
// $conf['redis_client_port']       = '6200';
// $conf['lock_inc']                = 'sites/all/modules/redis/redis.lock.inc';
// $conf['path_inc']                = 'sites/all/modules/redis/redis.path.inc';
// $conf['cache_backends'][]        = 'sites/all/modules/redis/redis.autoload.inc';
// $conf['cache_default_class']     = 'Redis_Cache';
// $conf['redis_client_password']   = "very_strong_password";

/**
 * Redis Configuration. Lando local only.
 */
// Can be "Predis".
$conf['redis_client_interface'] = 'Predis';
// Your Redis instance hostname.
$conf['redis_client_host']       = 'cache';
// For multiple sites on same Redis instance, unique identifier.
$conf['cache_prefix']['default'] = 'live_';
$conf['redis_client_port']       = '6379';
$conf['lock_inc']                = 'sites/all/modules/redis/redis.lock.inc';
$conf['path_inc']                = 'sites/all/modules/redis/redis.path.inc';
$conf['cache_backends'][]        = 'sites/all/modules/redis/redis.autoload.inc';
$conf['cache_default_class']     = 'Redis_Cache';