本文介绍了PHP错误:php_network_getaddresses:getaddrinfo失败:(同时从其他站点获取信息.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从外部来源获取信息,我收到以下错误:

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

昨天一切都很好,所以这个脚本发生了什么事情,该脚本不起作用,并给了我上面的错误?有解决此问题的解决方案或提示吗?

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);

我也尝试通过将DNS转换为IP,但是得到警告:failed to open

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";

我试图删除http,但仍然出现上述错误.

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

推荐答案

这是因为您无法解析主机名可能是DNS问题,主机无法访问...

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

尝试使用IP地址而不是主机名...ping该主机名... nslookup它...

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

这篇关于PHP错误:php_network_getaddresses:getaddrinfo失败:(同时从其他站点获取信息.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 01:50