Knowledgebase

Fixing 502 and 504 Gateway Timeout Errors Print

  • wordpress, troubleshooting, performance, plugins, cpanel, database, php, backup, cron, woocommerce
  • 0

The web server waited too long for PHP to respond. The request was too slow, not necessarily wrong.

Common triggers

  • Large imports or exports, especially WooCommerce products
  • Backup plugins archiving a big site in one pass
  • Bulk image regeneration
  • A plugin calling a slow external API
  • Database queries against very large tables

Fixes

  1. Raise max_execution_time to 300 in MultiPHP INI Editor.
  2. Split the job — import 200 products at a time instead of 5,000.
  3. Run heavy jobs via a cron job rather than through the browser.
  4. Check Resource Usage in cPanel; if you are hitting plan limits, the request is being throttled.
  5. Disable plugins one at a time to find a slow external call.

If it happens on ordinary page loads

That is not a timeout you should tune around — enable caching, review slow queries with Query Monitor, and open a ticket so we can check the server side. Persistent 502s across the whole site may indicate a server issue rather than a site issue.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot