【发布时间】:2018-01-17 02:21:10
【问题描述】:
注意问题出现在 Azure 服务器中。它不允许获取 CURL 的详细信息。
我在页脚中显示帖子有问题。当我尝试通过file_get_content 获取它以及使用CURL 但仍然有问题。
$url="https://medium.com/@username/latest?format=json";
$homepage = file_get_contents($url);
echo "<pre>";
print_r($homepage);
echo "</pre>";
它在 Linux 中工作,但是当我在此之后移动到 Windows Azure 时会出现以下错误。
警告: file_get_contents(https://medium.com/@username/latest?format=json) [function.file-get-contents]:无法打开流:HTTP 请求 失败的! HTTP/1.1 403 禁止
【问题讨论】:
-
不,不是。我在 Azure 服务器中有问题