Php Curl请求失败(超时)

Php Curl请求失败(超时),php,curl,https,kml,Php,Curl,Https,Kml,我一直在通过cron作业从https nasa.gov网站请求kml文件。它已经运行了多年,但刚刚开始失败。我没有收到任何卷曲错误-请求只是超时。美国宇航局的网站一定发生了变化 $curl_connection = curl_init("http://firms.modaps.eosdis.nasa.gov/active_fire/kml/USA_contiguous_and_Hawaii_24h.kml"); //set options curl_setopt($curl_connec

我一直在通过cron作业从https nasa.gov网站请求kml文件。它已经运行了多年,但刚刚开始失败。我没有收到任何卷曲错误-请求只是超时。美国宇航局的网站一定发生了变化

$curl_connection = 
  curl_init("http://firms.modaps.eosdis.nasa.gov/active_fire/kml/USA_contiguous_and_Hawaii_24h.kml");

//set options
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($curl_connection, CURLOPT_USERAGENT, 
  "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, true);
curl_setopt( $curl_connection, CURLOPT_SSL_VERIFYHOST, 0);

//perform our request
$string = curl_exec($curl_connection);

//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' . 
curl_error($curl_connection);

//close the connection
curl_close($curl_connection);
美国宇航局的网站一定发生了变化

看起来他们现在正在使用HTTPS:

$ curl http://firms.modaps.eosdis.nasa.gov/active_fire/kml/USA_contiguous_and_Hawaii_24h.kml
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://firms.modaps.eosdis.nasa.gov/active_fire/kml/USA_contiguous_and_Hawaii_24h.kml">here</a>.</p>
</body></html>
$curlhttp://firms.modaps.eosdis.nasa.gov/active_fire/kml/USA_contiguous_and_Hawaii_24h.kml
302发现
发现
文档已移动

这些年来,您在没有真实性保证的情况下使用了这些数据:)

这可能对您有用:


URL可能也已更改。但这是留给读者的练习。

如果你什么也没做,那么也许美国宇航局做过,问问他们\