Fix WordPress 504 and 508 Errors
504 Gateway Timeout and 508 Resource Limit Reached. What they mean on GoZen Host and how to fix them.
3 min read
504 and 508 errors both mean a request couldn’t be completed, but for different reasons. On GoZen Host, the 508 is especially important because it comes from CloudLinux resource limits.
A 504 can occasionally be infrastructure-side (database slowdown, upstream timeout). Glance at status.gozenhost.com to rule that out before tuning your own stack. 508 is virtually always local (your account hit its limits) - status page won’t change that.
508 Resource Limit Reached
This is a CloudLinux-specific error. It means your account hit one of its resource limits: CPU, memory, entry processes (concurrent PHP workers), or I/O.
Why It Happens
- Traffic spike (legitimate or bot-driven)
- Heavy plugin running a background task (WooCommerce cron, sitemap generation, backup)
- No page caching, so every visitor triggers a full PHP execution
- Multiple cron jobs running simultaneously
- A bot hammering your site (check access logs)
Quick Fix
- Go to cPanel > Metrics > Resource Usage
- Check which resource has faults (red bar):
- CPU - your PHP scripts are too demanding
- PMEM - your processes need more RAM
- EP (Entry Processes) - too many concurrent PHP requests
- IO - too much disk activity
Long-Term Fixes
Enable caching (biggest impact):
LiteSpeed Cache serves pages without running PHP. A cached page uses zero entry processes, zero CPU, and negligible I/O.
Block bad bots:
# Add to .htaccess
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (AhrefsBot|SemrushBot|DotBot|MJ12bot|BLEXBot) [NC]
RewriteRule .* - [F,L]
Move WP-Cron to a real cron job:
Add to wp-config.php:
define('DISABLE_WP_CRON', true);
Then set up a real cron job in cPanel (Cron Jobs > run wp-cron.php every 15 minutes) instead of letting WordPress run it on every page load.
Optimize plugins: deactivate plugins you don’t actively use. Check CloudLinux Resource Limits for the full optimization guide.
Upgrade your plan: if you’ve optimized and still hit limits, you’ve outgrown your current plan. See Outgrown Shared Hosting?
504 Gateway Timeout
A 504 means the web server waited too long for PHP to respond and gave up. The PHP process is either still running (slow) or crashed.
Common Causes
- A PHP script takes longer than the server timeout (usually 60-120 seconds)
- A large database query that takes too long
- An external API call that hangs (payment gateways, shipping calculators)
- Plugin doing a heavy import/export operation
Fixes
Increase PHP timeout (temporary, for one-off tasks):
- Go to cPanel > Select PHP Version > Options
- Set
max_execution_timeto300(5 minutes) - Set it back to
60or120after your task completes
Optimize slow queries:
Install the Query Monitor plugin to find which database queries are taking too long. Look for queries that take more than 1 second.
Check external API calls:
If the timeout only happens on specific pages (checkout, shipping calculation), the page is probably waiting on an external API. Check if the third-party service is down.
WooCommerce-specific:
If 504 errors happen during WooCommerce order processing:
- Go to WooCommerce > Status > Scheduled Actions
- Check the Past-due and Failed tabs. Pending actions are real work (subscription renewals, order emails, webhooks), so don’t delete them. Run past-due actions from that screen instead
- Delete only completed or failed actions (see Clear WordPress Scheduled Action Logs)
- Check that WP-Cron or a real cron job is actually running, so the queue keeps moving
508 vs 504: How to Tell
| Error | Cause | Where to Look |
|---|---|---|
| 508 | CloudLinux resource limit hit | cPanel > Resource Usage |
| 504 | PHP script timeout | Error logs (~/public_html/error_log) |
If you see both, the 508 is likely the root cause. CloudLinux is killing your PHP processes because they exceeded resource limits, which the web server then reports as a timeout.
What to Do Next
- CloudLinux Resource Limits - understand and optimize your resource usage
- LiteSpeed Cache for WordPress - caching eliminates most 508 errors
- Outgrown Shared Hosting? - when optimization isn’t enough
- Upgrade to VPS - dedicated resources, no CloudLinux limits
Last updated 21 Oct 2026, 00:00 +0300.