【问题标题】:PHP file_get_contents not workingPHP file_get_contents 不起作用
【发布时间】:2013-06-30 21:01:40
【问题描述】:

我遇到了 PHP file_get_contents 的问题。

$html = file_get_html($csfd_link);

写入错误:

警告:file_get_contents() [function.file-get-contents]: php_network_getaddresses:getaddrinfo 失败:名称或服务没有 在第 76 行的 /home/vo003500/www_root/admin/simple_html_dom.php 中已知

警告:file_get_contents(http://www.example.com/) [function.file-get-contents]:无法打开流: php_network_getaddresses:getaddrinfo 失败:名称或服务没有 在第 76 行的 /home/vo003500/www_root/admin/simple_html_dom.php 中已知

我不知道它是什么。服务器是allow_url_fopen ON

谢谢

编辑: 到现在为止它工作,但过去 2 周没有工作......

【问题讨论】:

  • 这意味着它无法将DNS名称转换为IP......
  • 变量$csfd_link中有什么?您可能会发现它不是有效的文件名或 URL。

标签: php


【解决方案1】:

您似乎遇到了 DNS(域名服务)解析错误。确保/etc/resolv.conf 中有正确的 DNS 服务器条目。

【讨论】:

  • 这不是一个答案,它应该是一个评论,因为它只是建议而不是解决方案。
猜你喜欢
  • 2012-08-30
  • 1970-01-01
  • 2021-08-12
  • 1970-01-01
  • 2014-01-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多