oajmi
oajmi

Reputation: 307

Name or service not known [tcp://redis:6379]

i am having a problem setting up redis cache with laravel. i have a redis server runnig on my local machine:

enter image description here

my .env:

enter image description here

i have the localhost on port 6379 ready and listened:

enter image description here

someone plz tell me what's happenig here?enter image description here

Upvotes: 19

Views: 32477

Answers (2)

amit rosenberg
amit rosenberg

Reputation: 1

I've added this to my /etc/hosts and it fixed the error

127.0.0.1 redis

Laradoc + laravel (5.6)

Upvotes: -2

Eytan Avisror
Eytan Avisror

Reputation: 2970

Change REDIS_HOST=redis to REDIS_HOST=localhost, it is looking for a host named redis and not finding it, since redis is installed on the same machine you should use localhost or 127.0.0.1.

Once you've done this, make sure you reload the .env config - php artisan config:clear

Upvotes: 52

Related Questions