Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP error: php_network_getaddresses: getaddrinfo failed: (while getting information from other site.)

Tags:

php

warnings

Trying to get information from an external source, I'm receiving the following error:

Warning: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in line #...

Yesterday everything was fine, so what happened to this script, which is not working and gives me the error above? Any solution or hint to solve this problem?

$uri = "http://api.hostip.info/?ip=$ip&position=true";  $dom->load($uri); 

I also tried by converting DNS to IP but then I get the warning: failed to open

$uri = "174.129.200.54/?ip=$ip&position=true"; 

I tried to remove the http but am still getting the above error.

like image 266
Imran Khan Avatar asked Jun 08 '11 07:06

Imran Khan


1 Answers

It's because you can't resolve the host name Maybe DNS problems, host is unreachable...

try to use IP address instead of host name... ping this host name... nslookup it...

like image 193
Dmitri Gudkov Avatar answered Oct 13 '22 11:10

Dmitri Gudkov