问题与本地php fopen脚本在CentOS上返回404

我今天在使用file_get_contents或类似的fopen函数在我们的服务器上运行的php脚本有一些麻烦。 我认为这是一个openssl防火墙的错误,但我很新的服务器pipe理员的东西,所以我需要一些帮助debugging它。 我正在修改iptablescsf firewall设置,并试图在突然停止工作时使用proftpdconfigurationsftp。

一个简单的testing:(这个gif文件通过浏览器加载)

 echo file_get_contents("https://www.this-domain.com/logo.gif"); //...failed to open stream:HTTP request failed! HTTP/1.1 404 Not Found... //However both of the following work absolutely fine: //a local request to the same file: echo file_get_contents("/home/user/domains/this-domain.com/private_html/media/logospin.gif"); //an external absolute url: echo file_get_contents("https://www.google.com/"); 

在php.ini中,我有: allow_url_fopen = onextension=php_openssl.dll 。 有任何想法吗?

这个问题实际上是一个DNS问题。 由于某种原因, file_get_contents()奇怪地通过我们的备份域名服务器(ns3&ns4),而浏览器通过主名称服务器(ns1&ns2)进行路由。 不同于初选,备份指向一个不同的服务器,它还没有相同的文件 – 因此是不寻常的404。

我已经设置了这些备份域名服务器只有几个小时之前修改防火墙等,当他们传播时,它看起来非常像ssh命令已离线file_get_contents()