Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

How to use Redis? #287

Closed
jiv-e opened this issue Oct 29, 2015 · 3 comments
Closed

How to use Redis? #287

jiv-e opened this issue Oct 29, 2015 · 3 comments
Labels

Comments

@jiv-e
Copy link

jiv-e commented Oct 29, 2015

What would be the steps to get Redis working on drupal-vm? I have added these:

playbook.yml

# Conditionally-installed roles.
  - { role: geerlingguy.redis, when: '"redis" in installed_extras' }

config.yml

installed_extras:
  - redis

settings.php

$conf['cache_prefix']['default'] = 'myprefix_';
$conf['redis_client_interface'] = 'PhpRedis'; // Can be "Predis".
$conf['redis_client_host'] = '127.0.0.1'; // Your Redis instance hostname.
$conf['lock_inc'] = 'sites/all/modules/contrib/redis/redis.lock.inc';
$conf['path_inc'] = 'sites/all/modules/contrib/redis/redis.path.inc';
$conf['cache_backends'][] = 'sites/all/modules/contrib/redis/redis.autoload.inc';
$conf['cache_default_class'] = 'Redis_Cache';

The result is an error:

Fatal error: Class 'Redis' not found in /var/www/project/sites/all/modules/contrib/redis/lib/Redis/Client/PhpRedis.php on line 9

Is suppose I need to install PhpRedis. Is there any recommended role to use?

@geerlingguy
Copy link
Owner

You're 99.9% of the way there; the last part is just adding php5-redis to the set of php_packages in config.yml

For a complete example of setting up Redis with Drupal/PHP via Ansible for Drupal VM (the example is actually from the Raspberry Pi Dramble project!), see this commit:

geerlingguy/raspberry-pi-dramble@d74afc4

Would you like Redis to be added as a top-level optional install (just like memcached)? If so, could you add a separate issue in the queue titled "Add Redis as optional install".

Thanks!

@jiv-e
Copy link
Author

jiv-e commented Oct 30, 2015

Great, thanks!

@geerlingguy
Copy link
Owner

A note for posterity; Redis is officially supported in Drupal VM as of Dec 12 2015!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants