Skip to content

Commit e22c77d

Browse files
[12.x] Add support for Redis Unix socket connections with PhpRedis (#10306)
* Update redis, add Unix socket instructions Add Unix socket configuration instructions for Redis * Update redis.md --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent c4f646c commit e22c77d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: redis.md

+10
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,16 @@ In addition to the default configuration options, PhpRedis supports the followin
210210
],
211211
```
212212

213+
<a name="unix-socket-connections"></a>
214+
#### Unix Socket Connections
215+
216+
Redis connections can also be configured to use Unix sockets instead of TCP. This can offer improved performance by eliminating TCP overhead for connections to Redis instances on the same server as your application. To configure Redis to use a Unix socket, set your `REDIS_HOST` environment variable to the path of the Redis socket and the `REDIS_PORT` environment variable to `0`:
217+
218+
```env
219+
REDIS_HOST=/run/redis/redis.sock
220+
REDIS_PORT=0
221+
```
222+
213223
<a name="phpredis-serialization"></a>
214224
#### PhpRedis Serialization and Compression
215225

0 commit comments

Comments
 (0)