From 26838ec64d95577d50ac046fd76fdd62a349a0c8 Mon Sep 17 00:00:00 2001 From: Julian Pustkuchen <3110-Anybody@users.noreply.drupalcode.org> Date: Fri, 16 Aug 2024 19:59:25 +0000 Subject: [PATCH] Issue #2789965 by Anybody, pucowanje, introfini, vensires: Better documentation on how to allow Socket Connections --- README.PhpRedis.txt | 5 +++-- README.Predis.txt | 4 ++++ settings.redis.example.php | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.PhpRedis.txt b/README.PhpRedis.txt index ee58879..99832cc 100644 --- a/README.PhpRedis.txt +++ b/README.PhpRedis.txt @@ -36,9 +36,10 @@ Add the new instance setting: Connect via UNIX socket ----------------------- -Just add this line to your settings.php file: +Just add these lines to your settings.php file: - $conf['redis_cache_socket'] = '/tmp/redis.sock'; + $settings['redis.connection']['host'] = '/tmp/redis.sock'; // Your Redis socket + $settings['redis.connection']['port'] = 0; // For socket connections the port must be 0 Don't forget to change the path depending on your operating system and Redis server configuration. diff --git a/README.Predis.txt b/README.Predis.txt index 1dd39b0..e7eba16 100644 --- a/README.Predis.txt +++ b/README.Predis.txt @@ -21,6 +21,10 @@ $settings['redis.connection']['interface'] = 'Predis'; $settings['redis.connection']['host'] = '1.2.3.4'; // Your Redis instance hostname. $settings['cache']['default'] = 'cache.backend.redis'; +Or connect via socket: +$settings['redis.connection']['host'] = '/tmp/redis.sock'; // Your Redis socket +$settings['redis.connection']['port'] = 0; // For socket connections the port must be 0 + To add more magic with a primary/replica setup you can use a config like this: $settings['redis.connection']['interface'] = 'Predis'; // Use predis library. diff --git a/settings.redis.example.php b/settings.redis.example.php index e82d22a..0a3f2cd 100644 --- a/settings.redis.example.php +++ b/settings.redis.example.php @@ -15,6 +15,10 @@ if (!InstallerKernel::installationAttempted() && extension_loaded('redis')) { // $settings['redis.connection']['host'] = '127.0.0.1'; // $settings['redis.connection']['port'] = 6379; + // Use UNIX socket instead: + // $settings['redis.connection']['host'] = '/tmp/redis.sock'; // Your Redis socket + // $settings['redis.connection']['port'] = 0; // For socket connections the port must be 0 + // Customize used interface. // $settings['redis.connection']['interface'] = 'PhpRedis'; -- GitLab