php-redisConnecting to Redis using unix socket
$r = new Redis();
$r->connect("/var/run/redis/redis-server.sock");ctrl + c| new Redis()create Redis object | connect(connect to specified unix socket | 
| /var/run/redis/redis-server.sockpath to unix socket file from Redis configuration | |
Usage example
<?php
$r = new Redis();
$r->connect("/var/run/redis/redis-server.sock");
echo $r->ping();output
1Related
More of Php Redis
- Using password to connect to Redis
- Using username and password to connect to Redis
- How to get all keys from Redis
- Check Redis connection
- How to auto reconnect to Redis
- Redis pub/sub example
- Save array to Redis
- Using Redis persistent (keepalive) connections
- Using Lua scripts in Redis
- Get key value from Redis
See more codes...