Jump to content

Curl error: couldn't connect to host


wombatservers

Recommended Posts

Make sure your server's hostname is set correctly. It should be the IP or hostname that you use to access your control panel. If you are using tcadmin v2 you also need to specify the port: hostname:8880

 

Also ask your hosting provider if they have connections to port 8880 blocked.

Link to comment
Share on other sites

Edit tcadmin_advanced.php or tcadmin2_advanced.php

Find this line:

$data = "0\t\t-1\tCurl error: " . curl_error($ch);

Replace with this:

$data = "0\t\t-1\tCurl error: " . curl_error($ch) . " Url: " .  curl_getinfo ( $ch,  CURLINFO_EFFECTIVE_URL);

Execute the create command again. It will show the url that whmcs is using to connect to tcadmin. Make sure it is correct. Copy and paste the command in your browser and you will see a message.

 

Create a file named curltest.php with these lines. Replace http://xxxxxxx:8880/billingapi.aspx with the correct url and upload to your hosting. Execute the page from your browser. You should see the same message that you saw when you pasted the url in your browser. If you don't see this it means connections to the port are blocked.

<?php
$ch = curl_init("http://xxxxxxx:8880/billingapi.aspx");
curl_exec($ch);
curl_close($ch);
?>

Link to comment
Share on other sites

Thanks for the advice, LFA.

 

When going to the URL found in the first step, I get an message stating:

 

"Please visit TCAdmin.com for help"

 

To clarify, should I be uploading curltest.php to my TCAdmin box or to my webserver running WHMCS?

 

Thanks, I really appreciate your assistance.

Link to comment
Share on other sites

  • 4 weeks later...

I'm getting a similar error:

 

Curl error: couldn't connect to host Url: http://node.****.com:8880/billingapi.aspx

 

I'm pretty sure the port is not blocked as it's a Windows Server and I've disabled Windows Firewall. My host also doesn't block any ports.

 

I contacted my website host who host WHMCS and they say Curl is enabled. Judging by the fact it's outputting an error like that then it is definitely enabled.

 

Help would be greatly appreciated, thanks.

 

EDIT: Found the issue. The host I use for my WHMCS/Website blocks the port 8880 on the outbound.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use