@Synch did you resolve this? How? Thanks!
php_network_getaddresses: getaddrinfo failed: Name or service not known
I'm having a problem with my database connection which doesn't work half of the time. If I try to do anything with the database the page will generate the following error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known (SQL: select * from `users` where `email` = [email protected] limit 1)
After a couple of reloads the page loads fine again...
I know the database settings are correct as sometimes the connections works fine. The database is located on another server which is connected through a local network. I tried to find an answer to this problem for the past two days but I'm a bit lost. Google gives me no clear answer. I suspect that there is some problem with the DNS lookup of the other database server, but I'm not sure (I already tried changing the DB address to a direct local address instead of the public DNS record's domain). I also tried restarting FPM, the DB and refreshing the database.
The database is running on MariaDB. Laravel version is 5.4. PHP version 7.1.7.
Does anyone have any experience with this error message?
Please or to participate in this conversation.