SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known

3,688 views
Skip to first unread message

AM

unread,
Jan 19, 2017, 3:41:43 AM1/19/17
to Fat-Free Framework
Hi,

on a site I built with F3 I´m recently getting this error, not every time, but far too often on different pages, pretty randomly:


Internal Server Error
SQLSTATE
[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known

Is that error related to F3 or is this caused by the hoster of the site?

Anatol

unread,
Jan 19, 2017, 3:47:38 AM1/19/17
to Fat-Free Framework
This sound something is wrong with your server setup.
I would propably start with /etc/hosts and localhost or the domain you´re using.

AM

unread,
Jan 19, 2017, 3:54:21 AM1/19/17
to f3-fra...@googlegroups.com
Thanks for your quick reply, Anatol.
This is a shared server and I did not change anything.
So it´s the hoster´s fault?

EDIT: Don´t really understand what you mean by "start with ...."

ikkez

unread,
Jan 19, 2017, 4:03:50 AM1/19/17
to f3-fra...@googlegroups.com
if it is randomly not reachable, it's most likely an issue with the server. Since it's a shared server, maybe the database server is not reachable everytime when it currently on heavy load (by other users?). Start with asking the hoster.

I guess it's not localhost what you have set as database host? if it is a hostname you've entered, maybe try to set it's IP instead,.. that'll skip the DNS check which could also be the problem here, if their DNS server has timeouts.

AM

unread,
Jan 19, 2017, 4:14:55 AM1/19/17
to Fat-Free Framework
The page itself cannot have such heavy load, yeah, probably another site on the shared server.

the dbhost is "db642XXXXXX.db.1and1.com".
Newbie Question: How do I find out the IP address?

Thanks again, quickest support ever!

Anatol

unread,
Jan 19, 2017, 9:08:04 AM1/19/17
to Fat-Free Framework
Hi AM,

I see it as Ikkez explained. It seems the server is under heavy load.

Newbie Question: How do I find out the IP address?

As far as I know there is no option in 1und1 backend to get the IP of your mysql server. As it´s not available
from outside you do not have a chance to resolve the IP from the hostname either.

The best thing you can do is write the support. An important information for them to hekp you is how you connect to the database server:
(PHP, "db642XXXXXX.db.1and1.com") and that this problem occures randomly.

cheers,

anatol

AM

unread,
Jan 19, 2017, 10:23:47 AM1/19/17
to Fat-Free Framework
Ok thanks, it seems it is the hoster who has trouble with the database.
Reply all
Reply to author
Forward
0 new messages