Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
594 views
in Technique[技术] by (71.8m points)

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

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.

question from:https://stackoverflow.com/questions/6275535/php-error-php-network-getaddresses-getaddrinfo-failed-while-getting-informat

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...