You are here

README.PhpRedis.txt in Redis 8

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

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

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.

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

Use the Sentinel high availability mode
---------------------------------------

Redis can provide a master/slave mode with sentinels server monitoring them.
More information about setting it : https://redis.io/topics/sentinel.

This mode needs the following settings:

Modify the host as follow:
    // Sentinels instances list with hostname:port format.
    $settings['redis.connection']['host']      = ['1.2.3.4:5000','1.2.3.5:5000','1.2.3.6:5000'];

Add the new instance setting:

    // Redis instance name.
    $settings['redis.connection']['instance']  = 'instance_name';

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 your operating system and Redis
server configuration.

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

See README.md file.

For this particular implementation, host settings are overridden by the
UNIX socket parameter.

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. Get PhpRedis
  5. ------------
  6. You can download this library at:
  7. https://github.com/nicolasff/phpredis
  8. This is PHP extension, too recent for being packaged in most distribution, you
  9. will probably need to compile it yourself.
  10. Default behavior is to connect via tcp://localhost:6379 but you might want to
  11. connect differently.
  12. Use the Sentinel high availability mode
  13. ---------------------------------------
  14. Redis can provide a master/slave mode with sentinels server monitoring them.
  15. More information about setting it : https://redis.io/topics/sentinel.
  16. This mode needs the following settings:
  17. Modify the host as follow:
  18. // Sentinels instances list with hostname:port format.
  19. $settings['redis.connection']['host'] = ['1.2.3.4:5000','1.2.3.5:5000','1.2.3.6:5000'];
  20. Add the new instance setting:
  21. // Redis instance name.
  22. $settings['redis.connection']['instance'] = 'instance_name';
  23. Connect via UNIX socket
  24. -----------------------
  25. Just add this line to your settings.php file:
  26. $conf['redis_cache_socket'] = '/tmp/redis.sock';
  27. Don't forget to change the path depending on your operating system and Redis
  28. server configuration.
  29. Connect to a remote host and database
  30. -------------------------------------
  31. See README.md file.
  32. For this particular implementation, host settings are overridden by the
  33. UNIX socket parameter.