I am using Laravel + Docker and I have a container for Redis. But when I run locally php artisan list
then I get this error. I want to run this command locally (not in container), I already did composer install
locally.
The reason I want to do this on my local machine is so that I could run other artisan commands on my machine (like create a new controller or model). It also helps with intelisense.
$ php artisan list
Predis\Connection\ConnectionException
php_network_getaddresses: getaddrinfo failed: No such host is known. [tcp://myapp-redis-server:6379]
If I change it to localhost, I get a different error REDIS_HOST=localhost
$ php artisan list
Predis\Connection\ConnectionException
No connection could be made because the target machine actively refused it. [tcp://localhost:6379]