snc/SncRedisBundle

socket connection fails

araab opened this issue · 0 comments

araab commented

phpredis fails if a socket and a port number is used in the connect.

php > $redis = new \Redis();
php > $redis->connect('/tmp/redis.sock', 6379, 5, null, 5, 5);

Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in php shell code on line 1

Warning: Uncaught RedisException: php_network_getaddresses: getaddrinfo failed: Name or service not known in php shell code:1
Stack trace:
#0 php shell code(1): Redis->connect('/tmp...', 6379, 5, NULL, 5, 5)
#1 {main}
  thrown in php shell code on line 1
php > $redis->connect('/tmp/redis.sock', 0, 5, null, 5, 5);
php > $redis->connect('/tmp/redis.sock');

It only works without a port or port set to 0.

The pull request #643 changed the connect that a port is set and adds a test which expects the exception.

How is it possible to set the port to 0?