cURL Couldn't Connect to Host Errors

Problem

You see one of the following errors:

Curl Error - Couldn't connect to host (7)
Server Command Error - Curl Error - Couldn't connect to host (7)
Curl Error: Connection refused - Code 7
For more information about cURL errors, see libcurl Errors.

Cause

This error indicates that your firewall is blocking a necessary port.

For example, if you see Server Command Error - Curl Error - Couldn't connect to host (7) while working with a hosting server or provisioning module, a firewall is preventing WHMCS from accessing your hosting server.

Solution

Make certain that the necessary ports are open for inbound and outbound connections on all of your servers. cURL uses port 443 for most secure connections.

To find the port numbers that each hosting control panel uses, see your server module’s documentation.

Last modified: February 4, 2025