php - curl not working on windows -
this error getting on running script:
[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] =>
the script shown in below:
$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);
please me out.............
the info curl_errno() means "couldn't resolve host. given remote host not resolved.". hostname either wrong or needs included in local hosts file if it's not valid name resolvable current dns server.
echo curl_errno($ch)
result:
curle_couldnt_resolve_host (6)
if need hosts entry, it's in file:
c:\windows\system32\drivers\etc\hosts
Comments
Post a Comment