这是我在运行脚本时遇到的错误:
[content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.015 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [certinfo] => Array ( ) [redirect_url] =>
脚本如下所示:
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$output=curl_exec($ch);
$abc=curl_getinfo($ch);
curl_close($ch);
//echo $output;
print_r($abc);
请帮帮我.............
答案 0 :(得分:0)
curl_errno()中的信息表示“无法解析主机。给定的远程主机未解析。”。因此,如果您的主机名错误或需要包含在本地主机文件中,如果它不是可与您当前的DNS服务器解析的有效名称。
echo curl_errno($ch)
结果:
CURLE_COULDNT_RESOLVE_HOST (6)
如果你需要一个主机条目,它就在这个文件中:
C:\ Windows \ System32下\驱动程序\等\主机