I have issue with cURL request from live server. I already seen this url but not getting that solution.
Try to request local URL than its takes 562ms.
But the same code take 1.1 min from live URL.
below are the curl_getinfo($cSession)
details :
Array
(
[url] => http://***.***.**.**
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 62.261039
[namelookup_time] => 0.000148
[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
(
)
[primary_ip] =>
[primary_port] => 0
[local_ip] =>
[local_port] => 0
[redirect_url] =>
)
below I'm using code :
$cSession = curl_init();
//step2
curl_setopt($cSession, CURLOPT_URL,"$url");
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_ENCODING, 'gzip');
//step3
$result=curl_exec($cSession);
$cinfo = curl_getinfo($cSession);
//step4
curl_close($cSession);
//step5, result of curl
// echo $result;
print_r($cinfo);
Can anyone please help me, where I'm failed.