Curl Problem, Can not connect hosts
Posted: Mon Feb 08, 2010 9:44 pm
Hello,
This is my code:
When i run this script in my localhost, it works properly.
But when i uploaded to my server, it did not work and returned an error "can not connect to hosts"
I can load this URL from my brower, can someone please help me with this trouble ?
I have tried "http" instead of "https" but nothing change,
This is my code:
Code: Select all
$ch = curl_init('https://perfectmoney.com/acct/confirm.asp');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0");
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch).'|'.curl_errno($ch);
}
else
{
echo 'Operation completed without any errors'.curl_errno($ch);
}
curl_close($ch);
But when i uploaded to my server, it did not work and returned an error "can not connect to hosts"
I can load this URL from my brower, can someone please help me with this trouble ?
I have tried "http" instead of "https" but nothing change,