From 6b9fea9d091dc493206ff82f305af145211aef8b Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 7 Sep 2025 14:30:34 -0400 Subject: [PATCH] fix(cache): Set default Redis port to `0` for UNIX sockets When using phpredis with a UNIX socket, the port should either not be specified at all or be `<1`. https://github.com/phpredis/phpredis?tab=readme-ov-file#connect-open https://github.com/phpredis/phpredis/blob/d0b0c5cfdde9d49a265ca4bf7184e3998863aed0/library.c#L3332-L3334 Fixes #54813 Signed-off-by: Josh --- lib/private/RedisFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/RedisFactory.php b/lib/private/RedisFactory.php index dcb56cee9ef8d..8f234d9c4430e 100644 --- a/lib/private/RedisFactory.php +++ b/lib/private/RedisFactory.php @@ -77,7 +77,7 @@ private function create() { $this->instance = new \Redis(); $host = $config['host'] ?? '127.0.0.1'; - $port = $config['port'] ?? ($host[0] !== '/' ? 6379 : null); + $port = $config['port'] ?? ($host[0] !== '/' ? 6379 : 0); $this->eventLogger->start('connect:redis', 'Connect to redis and send AUTH, SELECT'); // Support for older phpredis versions not supporting connectionParameters