php - Ubuntu iptable 搞砸 file_get_contents()

标签 php networking ubuntu

我正在设置我的 ubuntu Web 服务器,并在其上设置防火墙。除了我的一个文件有 file_get_contents() 之外,一切都很好。我只是想知道我需要解锁哪个端 Eloquent 能使其正常工作。

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/site/videos.php on line 65

这是我从文件中得到的警告。我确定这是一个端口问题,因为如果全部畅通,它就可以正常工作。任何帮助都会很棒!

file_get 的代码:
$xml = simplexml_load_string(file_get_contents('http://gdata.youtube.com/feeds/api/users/TomSka/uploads'));

最佳答案

要更改链接中详细说明的防火墙设置,它将起作用。请引用以下文件

http://www.radiotope.com/content/safari-and-sonicwall

设置是“使用 CFS 强制执行主机标记搜索”

奇怪的是,它似乎只影响在 Linux 其他平台上运行的 PHP 5 上的 fget,其他 PHP 生成的 HTTP 请求不受影响。

关于php - Ubuntu iptable 搞砸 file_get_contents(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17140225/

相关文章:

一段时间后PHP重置 session

javascript - 按钮和内容可编辑功能

c++ - 如何在 Symbian C++ 中获取网络类型(2G/3G/Wi-Fi)?

linux - 审计 Linux 上打开/关闭的端口

python - flask 、 react 和 Docker : Non-Zero Codes

php - 无法在 128 次尝试中为 "value"生成随机唯一值

访问 PHP superglobals 的 PHP 扩展库

networking - 如何知道何时完成接收 TCP 流?

linux - Apache 虚拟主机 - xxx.241.214.xxx :80 has no VirtualHosts

ruby-on-rails - 无法在 Linode Ubuntu 10.04 框中通过 sudo mate 命令打开 nginx.conf 文件