Reloading .env variables without restarting server (Laravel 5, shared hosting)

前端 未结 7 2130
旧巷少年郎
旧巷少年郎 2020-12-23 13:46

My Laravel 5 has run OK until the database was configured, then found this error:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name o         


        
相关标签:
7条回答
  • 2020-12-23 14:40

    In config/database.php I changed the default DB connection from mysql to sqlite. I deleted the .env file (actually renamed it) and created the sqlite file with touch storage/database.sqlite. The migration worked with sqlite.

    Then I switched back the config/database.php default DB connection to mysql and recovered the .env file. The migration worked with mysql.

    It doesn't make sense I guess. Maybe was something serverside.

    0 讨论(0)
提交回复
热议问题