Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chilitomato's avatar

Redis Driver Setup

I have my Redis server setup and running correctly. The Redis extension is installed via pecl, and I am able to run Laravel cache/session/queue via Redis by setting 'client' => 'phpredis'.

Now I would like to connect via Unix socket instead of TCP. The Redis conf setup is no problem; I verified that I can connect with redis-cli via the Unix socket file. However, the proper settings in database.php elude me. I cannot find any info on this in the docs, and the little I have found online seems geared towards predis, and not compatible with the phpredis driver.

Can somebody tell me the proper Laravel config for phpredis x Unix sockets?

0 likes
1 reply
chilitomato's avatar
chilitomato
OP
Best Answer
Level 1

This works:

REDIS_HOST=/var/run/redis/redis.sock
REDIS_PASSWORD=barfoo
REDIS_PORT=null

Pay attention to the permissions on the sock file AND on the folder that contains the sock file.

1 like

Please or to participate in this conversation.