cURL error 28 PHP Origin: Application & API OSI layer 7 · Application Last updated 13 Oct 2026

cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received

A PHP cURL (or Guzzle) request timed out before the remote server answered.

Exact message you may see cURL error 28Operation timed out afterConnection timed out after
Seen on: PHP

Meaning

Error 28 is cURL’s timeout. “0 bytes received” usually means the connection was never answered (firewall, wrong host); a partial byte count means the server was too slow.

Common causes

  • Remote API slow or down
  • Outbound firewall on the host blocking the port
  • DNS slow
  • Timeout set very low

⚡ Quick fix

  1. Test reachability from the server with curl on the command line
  2. Set sensible CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT
  3. Retry idempotent calls with backoff

Detailed fix by platform

PHP

  1. Guzzle: new Client(['connect_timeout' => 5, 'timeout' => 20])

How to diagnose

  1. Bytes — 0 bytes (no answer) or partial (slow)?
  2. Reachability — curl from the same server

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

499 — HTTP 499 Client Closed Request (Nginx) (HTTP)499522 — Cloudflare Error 522: Connection Timed Out (Cloudflare)522524 — Cloudflare Error 524: A Timeout Occurred (Cloudflare)524body already used — TypeError: Failed to execute 'json' on 'Response': body stream already read (JavaScript)body already usedcURL error 35 — cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to host:443 (PHP)cURL error 35cURL error 6 — cURL error 6: Could not resolve host: api.example.com (PHP)cURL error 6DEADLINE_EXCEEDED — gRPC Error: 4 DEADLINE_EXCEEDED: Deadline exceeded (API)DEADLINE_EXCEEDEDEndpoint request timed out — API Gateway: {"message": "Endpoint request timed out"} (504 after 29 seconds) (AWS)Endpoint request time…cURL erro…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.