Curl Problem, Can not connect hosts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
picos
Forum Newbie
Posts: 2
Joined: Mon Feb 08, 2010 9:39 pm

Curl Problem, Can not connect hosts

Post by picos »

Hello,
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);
 
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,
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Curl Problem, Can not connect hosts

Post by klevis miho »

Maybe your host doesn't have the cURL library installed
picos
Forum Newbie
Posts: 2
Joined: Mon Feb 08, 2010 9:39 pm

Re: Curl Problem, Can not connect hosts

Post by picos »

Curl was installed perfectly. When i try to replace other URL, it works.
But with this URL, it does not work.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Curl Problem, Can not connect hosts

Post by klevis miho »

Don't know now, maybe its the https :(
Post Reply