Skip to content

Commit f36455e

Browse files
joshtrichardsAndyScherzinger
authored andcommitted
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 <josh.t.richards@gmail.com>
1 parent 64480de commit f36455e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/RedisFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private function create() {
7777
$this->instance = new \Redis();
7878

7979
$host = $config['host'] ?? '127.0.0.1';
80-
$port = $config['port'] ?? ($host[0] !== '/' ? 6379 : null);
80+
$port = $config['port'] ?? ($host[0] !== '/' ? 6379 : 0);
8181

8282
$this->eventLogger->start('connect:redis', 'Connect to redis and send AUTH, SELECT');
8383
// Support for older phpredis versions not supporting connectionParameters

0 commit comments

Comments
 (0)