How do I fix a "504 Gateway Timeout" error? Print

  • 0

A 504 means a request took too long for the backend to finish. It usually points to a slow query, large import, or external API call.

  1. Identify the slow action — a big import, backup, or report often triggers it. Break large jobs into smaller batches.
  2. In cPanel MultiPHP INI Editor, raise max_execution_time and max_input_time for long scripts.
  3. Optimize slow database queries and clear bloated tables (e.g. WordPress transients).
  4. If an external API your site calls is down, the wait causes the timeout — add a shorter timeout in your code.
  5. Clear caches to rule out a stored error.

If short, simple pages also time out, open a ticket with details.


Was this answer helpful?

« Back