Geonode logo
Library and script errors

How to Fix curl Error 28 (Operation Timed Out)

A phase-by-phase reading of the message, three ranked fixes and WordPress steps that need no terminal.

Updated

TL;DR

curl error 28 (CURLE_OPERATION_TIMEDOUT) means curl, or a program built on libcurl such as PHP or WordPress, stopped waiting because one of its time limits ran out. Find which phase stalled, then raise that limit or fix the slow DNS, server or proxy behind it.

What curl error 28 looks like

Captured with macOS's bundled curl on local test servers. Releases since late 2024 print the Connection timed out row where the two Older curl rows appear. The WordPress row is built from WordPress source.

WhereWhat you see
curl, --max-time reached with no reply from the servercurl: (28) Operation timed out after 3003 milliseconds with 0 bytes received
curl, time ran out while still connectingcurl: (28) Connection timed out after 3011 milliseconds
Older curl, --connect-timeout reached with no TCP answercurl: (28) Failed to connect to 127.0.0.2 port 48977 after 2002 ms: Timeout was reached
curl, DNS lookup unfinished at the limitcurl: (28) Resolving timed out after 2011 milliseconds
curl, --speed-limit 100 with --speed-time 3curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 3 seconds
Older curl, HTTP proxy never answers CONNECTcurl: (28) Proxy CONNECT aborted due to timeout
WordPress Site Health, loopback testError: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)

Why this happens

curl times each request, and yours was not finished when the time ran out.

The limit comes from your command, the program calling libcurl or the operating system, and one code covers a slow DNS lookup, an unanswered connection and a stalled download.

Diagnose your curl error 28 first

The text after (28) hints at the phase; these checks confirm it.

  • Load the URL in a web browser on the same computer; if the page hangs there too, the site or network is slow, not curl.

  • Read the words after (28); Resolving means DNS, Connection or Failed to connect means connecting never finished, and Operation means the stall came after connecting.

  • Rerun with -v; an error right after Trying means the TCP connection got no answer, and a Client hello without a reply means TLS stalled.

  • Add -w '%{time_namelookup} %{time_starttransfer}'; if the first prints 0.000000, DNS never finished, and a second above zero means the download had started.

  • For an https:// URL through a proxy, add -w '%{http_connect}'; 000 means the proxy sent no CONNECT reply, and 200 means the tunnel opened first.

Solutions ranked by effectiveness

Start with the limit itself, then the WordPress case, then the proxy route.

  1. Most common fix

    Set limits that fit each phase

    Applies when the same request succeeds once it gets more time. Keep connecting on a short limit, give the whole request a longer one, and judge large downloads by speed.

    # Whole request: 10 s to connect, 60 s in total
    curl --connect-timeout 10 --max-time 60 https://example.com/
    
    # Large download: no total limit, stop if under 1000 bytes/s for 30 s
    curl --connect-timeout 10 --speed-limit 1000 --speed-time 30 \
      -O https://example.com/file.zip
  2. Site owners

    Find what stalls WordPress requests

    Applies when the error shows up in the WordPress dashboard or a plugin's log. WordPress waits 5 seconds by default, 10 in Site Health tests, for each request it sends.

    1. Open Tools > Site Health; the Status tab names the test that failed.

    2. On Plugins > Installed Plugins, deactivate plugins one by one until the timeout stops.

    3. Loopback or REST API test failing: ask your host why the site cannot reach itself.

    4. Outside requests failing: ask whether wp-config.php sets WP_PROXY_HOST, a proxy for outgoing requests.

  3. For developers

    Fix the proxy leg that stalled

    Applies when the timeout appears only with -x. Either leg can stall, yours to the proxy or the proxy's to the site, and the URL scheme decides which limit covers the second.

    1. Verbose output ends at Trying with the proxy's address: recheck its host and port.

    2. https:// URL: raise --connect-timeout, which also covers the proxy's CONNECT step.

    3. http:// URL: raise --max-time, because the proxy's hop to the site counts there.

    4. Tunnel opens but the site stalls: test it without -x before blaming the proxy.

Stop the curl error 28 from coming back

Settings worth making permanent once the request works again.

  1. Put --max-time, or CURLOPT_TIMEOUT in PHP, on every scripted call; the default of 0 means no overall limit.

  2. Add --retry with a small count to unattended jobs; curl treats a timeout as transient and doubles each wait.

  3. In WordPress code, pass a timeout argument to wp_remote_get() for the one slow API you call.

  4. Set both speed options: --speed-limit alone checks over 30 seconds, and --speed-time alone uses a 1 byte per second floor.

Measure proxy latency yourselfGeonode's docs include a Python script that charts proxy latency and counts timeouts.
Try residential proxies

Related errors

Learn more

FAQ

A timer expired on your side before the request completed; libcurl names this CURLE_OPERATION_TIMEDOUT. The server may be working and merely slower than the wait you allowed.

Find the failing request on the Site Health screen, then switch plugins off one at a time until it passes. If that screen also reports an active PHP session, code calling session_start() is interfering with WordPress's own requests.

curl sets no limit on a whole transfer, and libcurl's built-in connect limit is 300 seconds. The operating system may give up sooner: in our test macOS dropped an unanswered connection after 75 seconds, still as code 28.

--connect-timeout covers only the connection phase: the DNS lookup plus the TCP and TLS handshakes. --max-time caps the entire transfer, that phase included, so whichever runs out first ends the request.

Call curl_setopt() with CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT in seconds, or their _MS versions in milliseconds; CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME match --speed-limit and --speed-time. Guzzle shows the same failure as cURL error 28.

curl was still waiting for a DNS answer when the limit expired, so it never learned the server's address. Lookup time counts toward --connect-timeout; test the host name with nslookup on the same machine.

Run curl jobs side by side

Geonode's docs list no fixed thread cap for residential proxies.