WordPress Site Health showing cURL error 28: Operation timed out, payment plugins failing, or a Laravel HTTP client throwing connection exceptions: all mean the server's outgoing request did not complete. The website itself may be fine. This guide covers the common cURL error numbers and how to fix them.
Before you start
- The URL the code was calling (from the error message or log).
- SSH access on a VPS; on cPanel hosting, Terminal access helps.
Know the error number
| Error | Meaning |
|---|---|
| 6 Could not resolve host | DNS lookup failed on the server |
| 7 Failed to connect | Connection refused or blocked |
| 28 Operation timed out | No (complete) response within the timeout |
| 35 SSL connect error | TLS handshake failed |
| 60 SSL certificate problem | Certificate could not be verified |
Reproduce from the server
curl -sv -o /dev/null -m 20 https://api.example.com/endpointRun it as the same server (not your laptop). Add -4 or -6 to test IPv4 and IPv6 separately. If curl on the command line also hangs, the problem is network/DNS/firewall; if it works there but not in PHP, look at PHP settings and the code.
Fix error 28: timeouts
- IPv6 problems: the server has an IPv6 address but no working IPv6 route, so connections hang before falling back. If
curl -4works andcurl -6hangs, fix IPv6 or force IPv4 in code (CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4). - The remote API is slow or down: check its status page; nothing to fix on your side except retries.
- Timeout set too low: WordPress's default HTTP timeout is 5 seconds for many requests. Raise it for a specific call (
'timeout' => 20inwp_remote_get) rather than globally. - Loopback requests time out (WordPress Site Health "loopback request failed"): the server cannot reach its own domain. Check that the domain resolves on the server to the right IP, and that a firewall or Cloudflare challenge does not block the server's own IP.
- Outbound firewall: CSF or UFW rules blocking outgoing 443/80. Allow them in
TCP_OUTor the outgoing policy.
Fix error 6: DNS
The server cannot resolve names. Test with dig api.example.com and fix the resolver configuration (see the name resolution guide).
Fix error 7: connection failed
- Remote port closed or the remote side blocks your server's IP (check with the API provider; some require IP allowlisting).
- Local outbound firewall rules.
- Calling a local service on the wrong host or port (for example
localhostinside a Docker container).
SSL-related errors (35, 60)
Update the server's CA certificates and OpenSSL, check the system clock, and make sure the remote site sends a complete certificate chain.
On cPanel hosting
Outbound connections are usually open, but the host may restrict some ports (for example SMTP 25) or IPs. If command-line curl from your account fails, contact support with the URL and error.
Check the fix
Rerun the curl test and the failing action (Site Health, plugin connection test, API call). The error should disappear from the logs.
cURL errors FAQ
Is cURL error 28 a problem with my website?
It is about requests your server makes, not visitors reaching you. But features depending on those requests (updates, payments, emails via API) will fail.
Should I just increase all timeouts?
No. Long timeouts make pages hang when an API is down. Raise them only for calls that legitimately take longer, and add retries.
Why does it fail only sometimes?
Intermittent DNS, an overloaded remote API or rate limiting. Log the timings to see patterns.
