On this page
What this issue is
A 5xx status code is a server-side error. The request reached your site, but the server could not complete it. Common ones are 500 (generic failure), 502 (bad gateway: a proxy got a bad answer from the app), 503 (unavailable or overloaded) and 504 (gateway timeout).
The word that matters here is intermittent. The page works when you test it, then fails for a share of visitors. That makes it easy to miss and hard to reproduce.
Why it costs you leads or sales
A visitor who gets an error page rarely retries. If it happens on a landing page, you pay for the ad click and get nothing. If it happens on a form submit or checkout step, you lose a person who was ready to act. Tracking tags often do not load on error pages either, so your ad platforms see fewer conversions and your reports look worse than the real picture.
- Ad clickVisitor lands from your campaign
- Landing page requestOrigin returns 502 or 503
- Form or checkoutNever reached
- Conversion tagNever fires
The error appears on some requests only, so the steps after it never happen for those visitors.
Example: with 50 leads per 1,000 clicks normally, a 10% error rate on the landing page removes about 5 of them. Numbers are illustrative.
How to check if your site has it
Read the server access log
Look for lines with status 500, 502, 503 or 504. Note the URLs and the times. Ask your host where the logs are if you cannot find them.
Read the error log
Check the web server error log and, for WordPress or PHP sites, the PHP error log. Match entries to the times of the 5xx lines.
Look for a pattern
Do errors cluster at certain hours, after traffic spikes, during backups or cron jobs, or on one URL only? The pattern points to the cause.
Check your CDN or proxy dashboard
If you use a CDN or load balancer, look at its origin error reports. Errors there that you cannot reproduce in a browser are a typical sign of intermittent origin failures.
Test repeatedly
Run the command below in a loop to see how often the page fails.
for i in $(seq 1 50); do curl -s -o /dev/null -w "%{http_code}\n" https://example.com/; sleep 1; done | sort | uniq -cHow to fix it
The fix depends on what the logs show. These are the most common causes and what to do about each.
| Symptom in logs | Likely cause | Fix |
|---|---|---|
| 502 or 504 under load, 'max_children reached' | PHP workers exhausted | Raise pm.max_children if memory allows, or upgrade the plan |
| 500 with 'Allowed memory size exhausted' | PHP memory limit too low | Raise memory_limit and find the heavy plugin or query |
| 500 with 'Error establishing a database connection' | Database connection limit or crash | Check max_connections, slow queries and database host health |
| 503 at fixed times | Backup, cron or import job hogging resources | Move the job off-peak or throttle it |
| 500 right after a deploy or plugin update | Faulty code or plugin conflict | Roll back and update one plugin at a time |
| 503 from host with rate or resource notices | Shared hosting resource limits | Upgrade or move to a bigger plan |
Turn on debug logging
In wp-config.php set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false. Read wp-content/debug.log after the next error.
Find the culprit plugin
On a staging copy, deactivate plugins in groups and repeat the load test. Pay attention to page builders, security and backup plugins.
Add full-page caching
A cache plugin or host-level cache serves pages without running PHP, which cuts load on PHP workers.
Raise limits or upgrade hosting
Ask your host for the PHP worker count and memory limit, and raise them if the logs show they run out.
Check Shopify status
Shopify runs the servers, so look at shopifystatus.com first for incidents.
Remove suspect apps or scripts
Apps and custom checkout or storefront calls to your own server (proxies, webhooks) can return 5xx. Disable recently added ones and retest.
Contact Shopify Support
If errors persist on core store URLs, send them the URLs, times and screenshots.
Check the app and proxy logs
Compare Nginx or Apache logs with application logs by timestamp to see where the failure starts.
Tune workers and timeouts
Make sure PHP-FPM, Node or app server worker counts and proxy timeouts fit your traffic and your slowest requests.
Add health checks and restarts
Use a process manager so crashed workers restart, and have your load balancer stop sending traffic to unhealthy instances.
Fix the slow queries
Enable the database slow query log and add indexes or cache results for the worst offenders.
Check Webflow status
Hosting is managed by Webflow, so check their status page for incidents.
Check external endpoints
If your forms or scripts call your own server or a third-party API, the 5xx is probably there. Test those endpoints directly.
How to confirm it's fixed
- The repeated curl test returns only 200 (or expected redirects) over many requests
- No new 5xx lines in the access log for at least 24 hours, including your busy hours
- The error log shows no new fatal errors or worker limit warnings
- Your form submit and checkout steps complete from a clean browser session
- CDN or load balancer origin error reports are back to zero
How to prevent it happening again
- Test updates and new plugins on staging before going live
- Schedule backups and cron jobs outside peak ad hours
- Use full-page caching so most visits do not hit PHP and the database
- Check resource usage before launching a big campaign and scale up first
- Set up uptime and journey monitoring on the pages that earn leads, not only the homepage
Example: 09:00
Campaign goes live and traffic rises
Example: 09:20
PHP workers fill up and some requests return 502
Example: 09:40
Load drops briefly, so the site works when you check
Example: 10:30
Errors return in the next spike
Example: next day
Logs reviewed, worker limit raised and caching added
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor loads your pages and runs your journeys on a schedule, from the EU or the US. If a page load or a confirmation step returns a server error or fails to complete, the check fails.
Because the problem is intermittent, FunnelGuard re-checks a failure from a second region before it alerts you. You then get one alert (email, Slack, Teams, WhatsApp, webhook or PagerDuty) with a screenshot and a likely cause. A check only samples your site at its schedule, so a very brief or rare error can be missed between runs. It tells you something is wrong and where; you still use your server logs to find the root cause.
The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial.
Frequently asked questions
See the questions below for quick answers.
Questions people ask
Why does my website sometimes show a 500 or 502 error?
The server is failing on some requests, usually because it runs out of PHP workers, memory or database connections under load, or because a plugin or job crashes. Check the server and PHP error logs for the exact times of the errors to see which.
What is the difference between 500, 502, 503 and 504 errors?
500 is a generic server failure. 502 means a proxy or gateway got a bad response from the app. 503 means the server is unavailable or overloaded. 504 means a gateway timed out waiting for the app.
How do I find the cause of random 5xx errors?
Match timestamps of 5xx lines in the access log with entries in the error log, PHP log and database slow query log. Then look for a pattern such as peak traffic, cron jobs, backups or one specific URL.
Can intermittent server errors hurt my ad results?
Yes. Visitors who hit an error page leave, you still pay for the click, and conversion tags may not fire. That lowers leads and makes campaign data look worse than it is.
Will a CDN stop 5xx errors?
Not by itself. A CDN can serve cached pages while the origin is down, which hides some errors, but uncached pages, form submits and checkout calls still reach the origin and can fail.
Why can't I reproduce the error myself?
Intermittent errors depend on load and timing, so most of your own visits succeed. Run a repeated request test or check logs and monitoring, which record the failures you do not see.
How can I get alerted when my site returns 5xx errors?
Use a monitor that loads your key pages and journeys on a schedule and alerts on failure. FunnelGuard does this with a second-region re-check, then sends one alert with a screenshot and a likely cause.
Related issues
- PRF-051TTFB spikes at certain times (cron, backups, traffic peaks)Fix guide
- PRF-062Server timeout (504) on form submit endpointFix guide
- PRF-053Full-page cache disabled or bypassed (WordPress cache plugin off)Fix guide
- PRF-050TTFB over 800 msFix guide
- PRF-074Site in maintenance mode left onFix guide
- PRF-073Hosting rate-limits or WAF blocks normal visitors from some countriesFix guide