普通网友 2013-09-09 15:56
浏览 160

PHP cURL错误500

I have been trying to get data from this web page. I found that I need to pass the camera id to this url using GET method to get image.

But every time I do a curl request I got http_code 500: internal server error

This is my code (I'm still trying out with static camera 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);

Result I get:

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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?