如何获取有关失败请求的更多信息

时间:2013-01-10 13:15:37

标签: php http

这是我收到的错误消息:

警告:file_get_contents(http://example.com/.../asoplayhd2.jpg)[function.file-get-contents]:无法打开流:HTTP请求失败!在 /home/dttrading/qtech.sk/static/agem_images_download.php 40

有没有办法找到有关请求失败原因的更多信息?

1 个答案:

答案 0 :(得分:0)

尝试使用curl

$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_exec($ch);

curl_close($ch);
相关问题