【发布时间】:2010-01-11 06:17:14
【问题描述】:
我正在使用 fopen 来检索 URL 的内容。 它适用于 http URL,但不适用于 https URL
谁能明白为什么??
<?php
//this works fine
echo ("<br><br>url 1 is ".OutputURL("http://nuenergy.acornsoftware.com.au/staff/interface/index.php"));
//returns nothing
echo ("<br><br>url 2 is ".OutputURL("https://nuenergy.acornsoftware.com.au/staff/interface/index.php"));
function OutputURL($url)
{
$handle = fopen($url, "r");
$contents = stream_get_contents($handle);
fclose($handle);
return $contents;
}
//
?>
【问题讨论】:
-
我删除了我的答案,因为我现在不打算进一步研究答案。希望你能找到一些帮助!
-
你的 php_openssl.dll 是否在 apache 中启用?