PHP cURL错误500

时间:2013-09-09 15:56:17

标签: php curl

我一直试图从这个web page获取数据。我发现我需要使用GET方法传递摄像机ID to this url来获取图像。

但是每次我发出curl请求时都会遇到http_code 500:内部服务器错误

这是我的代码(我还在尝试使用静态摄像头ID):

$curl = curl_init('http://www.mytransport.sg/content/mytransport/home/myconcierge/trafficcameras/jcr:content/par/cameras_slideshow.singleresult.html?cameraid=4701');

curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);

curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.28 Safari/537.36");
curl_setopt($curl, CURLOPT_REFERER, "http://www.mytransport.sg/content/mytransport/home/myconcierge/trafficcameras.html");
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl,CURLOPT_FOLLOWLOCATION,true);

$resp = curl_exec($curl);
echo $resp;
$header = curl_getinfo($curl);
echo "<pre>";
print_r($header);
echo "</pre>";

curl_close($curl);

结果我得到:

HTTP/1.1 500 Internal Server Error
Date: Mon, 09 Sep 2013 15:26:56 GMT
Server: Microsoft-IIS/5.0
Last-Modified: Thu, 04 Oct 2012 15:55:23 GMT
ETag: "7d2c5-402e-4cb3dc86ef0c0"
Accept-Ranges: bytes
Content-Length: 16430
Vary: Accept-Encoding
Cache-Control: must-revalidate, proxy-revalidate, private, must-revaildate, proxy-revalidate, private Connection: close
Content-Type: text/html

0 个答案:

没有答案