mardi 28 juillet 2015

Curl request to EC2 Instance from Godady server refusing conection

When I am sending curl request from godady's server to EC2 instance then every time I am getting connection refused error. But when I try the same code from another server or from localhost its working fine.

$ch = curl_init();
//curl_setopt($ch, CURLOPT_PROXY,$proxy_IP);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$output=curl_exec($ch);
if(curl_errno($ch))
{
    echo 'Curl error: ' . curl_error($ch);
}

curl_close($ch);
echo '<pre>';print_r($output);




Aucun commentaire:

Enregistrer un commentaire