gpt4 book ai didi

php - 文件()[函数.文件] : php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:51:35 26 4
gpt4 key购买 nike

从文件 ("http://www.otherdomain.com ") 获取内容时出现以下错误。

file() [function.file]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

域服务器是linux。

如何解决这个问题?

最佳答案

引用:

If you're having problems with fopen("url...") but you can run 'host url' in a shell window and get the correct lookup, here's why...

This has had me banging my head against it all day - finally I found the answer buried in the bug reports, but figured it should really be more prominent!

The problem happens when you're on an ADSL line with DHCP (like our office)... When the ADSL modem renews the DHCP lease, you can also switch DNS servers, which confuses apache (and hence PHP) - meaning that you can't look up hosts from within PHP, even though you can from the commandline.... The short-term solution is to restart apache.

You'll get "php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in ..." messages as symptoms. Restart apache, and they're gone :-)

Simon

Comment by Simon at php.net

关于php - 文件()[函数.文件] : php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2880563/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com