This is an old revision of the document!
How to use Redis in a UNIX socket
for Centos 7.X
- Stop redis
systemctl stop redis
- Copy the service file
cp /usr/lib/systemd/system/redis.service /etc/systemd/system/redis.service
- edit
/etc/systemd/system/redis.service
User=username Group=username
change username
to same user that runs PHP
- edit
/etc/redis.conf
change following
unixsocket /path/to/redis.sock unixsocketperm 770 logfile /path/to/redis.log dir /path/to/redis
change port
to 0 if TCP socket is no longer needed.
change owner of redis.conf to same username in above step
chown username:group /etc/redis.conf
if /path/to/redis
directory does not exist , please manually create it.
and make sure above mentioned socket path
, log path
and dir path
and are writable to designated user
- now start redis.
systemctl start redis
- Verify it started successfully:
systemctl status redis
- Check if everything is working well:
nc -U /path/to/redis.sock info