cURL error 28 🐘 PHP

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.

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 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.