0

Something strange is happening with my Laravel installation. When I run

php artisan config:cache

I get the following error:

php_network_getaddresses: getaddrinfo failed: Name or service not known
Exception message: 
Redis::connect(): php_network_getaddresses:
getaddrinfo failed: Name or service not known

When I clear the cache using php artisan config:clear the exception disappears. Does someone know where this comes from?

EDIT:

  • Redis-Host in .env is 127.0.0.1, so no address resolution is needed.
  • Also the error occures when calling $redis = new \Redis(); $redis->connect(env('REDIS_HOST'));
manifestor
  • 1,352
  • 6
  • 19
  • 34

1 Answers1

0

You have your cache driver set to Redis and your application can't connect to the Redis server on the host you provided. It is trying to connect when caching the config, check your redis connection parameters on config/database.php or change your cache driver on config/cache.php. These values can also be set on your .env file if present.

namelivia
  • 2,657
  • 1
  • 21
  • 24