You are here

README.PhpRedis.txt in Redis 7

Same filename and directory in other branches
  1. 8 README.PhpRedis.txt
  2. 7.3 README.PhpRedis.txt
  3. 7.2 README.PhpRedis.txt
PhpRedis cache backend
======================

This client, for now, is only able to use the PhpRedis extension.

This code is ALPHA code. This means: DO NOT USE IT IN PRODUCTION. Not until
I don't ship any BETA release as a full Drupal.org module.

Get PhpRedis
------------

You can download this library at:

  https://github.com/nicolasff/phpredis

This is PHP extension, too recent for being packaged in most distribution, you
will probably need to compile it yourself.

Tell Drupal to use the cache backend
------------------------------------

Usual cache backend configuration, as follows, to add into your settings.php
file like any other backend:

  $conf['cache_backends'][]            = 'sites/all/modules/redis/phpredis.cache..inc';
  $conf['cache_class_cache']           = 'Redis_Cache_PhpRedis';
  $conf['cache_class_cache_menu']      = 'Redis_Cache_PhpRedis';
  $conf['cache_class_cache_bootstrap'] = 'Redis_Cache_PhpRedis';
  // ... Any other bins.

Default behavior is to connect via tcp://localhost:6379 but you might want to
connect differently.

Tell Drupal to use the lock backend
-----------------------------------

Usual lock backend override, update you settings.php file as this:

  $conf['lock_inc'] = 'sites/all/modules/custom/redis/phpredis.lock.inc';

Connect via UNIX socket
-----------------------

Just add this line to your settings.php file:

  $conf['redis_cache_socket'] = '/tmp/redis.sock';

Don't forget to change the path depending on you operating system.

Connect to a remote host and database
-------------------------------------

See README.txt file.

For this particular implementation, host settings are overridden by the
UNIX socket parameter. Database setting of course is not.

File

README.PhpRedis.txt
View source
  1. PhpRedis cache backend
  2. ======================
  3. This client, for now, is only able to use the PhpRedis extension.
  4. This code is ALPHA code. This means: DO NOT USE IT IN PRODUCTION. Not until
  5. I don't ship any BETA release as a full Drupal.org module.
  6. Get PhpRedis
  7. ------------
  8. You can download this library at:
  9. https://github.com/nicolasff/phpredis
  10. This is PHP extension, too recent for being packaged in most distribution, you
  11. will probably need to compile it yourself.
  12. Tell Drupal to use the cache backend
  13. ------------------------------------
  14. Usual cache backend configuration, as follows, to add into your settings.php
  15. file like any other backend:
  16. $conf['cache_backends'][] = 'sites/all/modules/redis/phpredis.cache..inc';
  17. $conf['cache_class_cache'] = 'Redis_Cache_PhpRedis';
  18. $conf['cache_class_cache_menu'] = 'Redis_Cache_PhpRedis';
  19. $conf['cache_class_cache_bootstrap'] = 'Redis_Cache_PhpRedis';
  20. // ... Any other bins.
  21. Default behavior is to connect via tcp://localhost:6379 but you might want to
  22. connect differently.
  23. Tell Drupal to use the lock backend
  24. -----------------------------------
  25. Usual lock backend override, update you settings.php file as this:
  26. $conf['lock_inc'] = 'sites/all/modules/custom/redis/phpredis.lock.inc';
  27. Connect via UNIX socket
  28. -----------------------
  29. Just add this line to your settings.php file:
  30. $conf['redis_cache_socket'] = '/tmp/redis.sock';
  31. Don't forget to change the path depending on you operating system.
  32. Connect to a remote host and database
  33. -------------------------------------
  34. See README.txt file.
  35. For this particular implementation, host settings are overridden by the
  36. UNIX socket parameter. Database setting of course is not.