相关疑难解决方法(0)

file_get_contents - 无法打开流:HTTP请求失败!找不到HTTP/1.1 404

在将我的网站移动到新域后,我遇到了一些奇怪的问题,即file_get_contents.我不得不设置一个新域和IP地址(使用Plesk)来获得新的ssl证书.现在我的file_get_contents在同一个域上调用脚本给了我这个:

无法打开流:HTTP请求失败!找不到HTTP/1.1 404

如果我在另一台服务器上使用file_get_contents调用相同的url它工作正常,如果我从服务器调用www.google.com失败,那么它似乎只是在同一个服务器上调用url!

我觉得它可能与在一台服务器上拥有两个不同的ssl证书的两个IP有关,当我从服务器获取服务器的file_get_contents /(索引页面)时我得到了plesk'这是一个新的域'页面所以当它从自己的服务器调用时,它就像查找正确的虚拟主机一样.

澄清(希望!):

在托管域的服务器上:

file_get_contents('https://mydomain.com?limit=4&offset=0&s_date=2012-02-05&e_date=2012-03-13&order=release_date&dir=desc&cid=12');
Run Code Online (Sandbox Code Playgroud)

给出"无法打开流:HTTP请求失败!找不到HTTP/1.1 404"

file_get_contents('http://www.google.com');
Run Code Online (Sandbox Code Playgroud)

工作正常

在另一台服务器上

file_get_contents('https://mydomain.com?limit=4&offset=0&s_date=2012-02-05&e_date=2012-03-13&order=release_date&dir=desc&cid=12');
Run Code Online (Sandbox Code Playgroud)

工作良好.

我试过关闭ssl,我仍然遇到同样的问题.

php file-get-contents

16
推荐指数
3
解决办法
7万
查看次数

标签 统计

file-get-contents ×1

php ×1