500, 502, and 503 errors on hosting are server messages indicating something failed before the page reached the browser. Although they look similar, each one points to a different cause and has its own diagnostic procedure.
Below we explain what each error means, why they occur more frequently on shared hosting in Mexico, and how to fix them yourself before opening a support ticket.
Error 500: Internal Server Error
The 500 error is the most generic one. It means the server encountered an internal problem it cannot describe in more detail. In practical terms, something in your code or configuration broke the execution.
Most Common Causes
- Incorrect file or folder permissions. PHP needs to read your scripts; if permissions are too restrictive (or in some cases too open), the server rejects them.
- Errors in the
.htaccessfile. A single mistyped directive can break the entire site. - PHP syntax errors in your code. An extra parenthesis or missing semicolon can trigger an immediate 500.
- PHP memory limit exhausted. If your script consumes more RAM than allowed, the process dies and returns a 500.
- Corrupted plugin or theme (especially in WordPress after an update).
How to Fix a 500 Error
- Temporarily enable error display: add
ini_set('display_errors', 1);at the top of yourindex.phpand reload. - Check the server error log: in cPanel go to Metrics → Errors. The log gives you the exact line of the problem.
- In WordPress, deactivate all plugins by renaming the
wp-content/pluginsfolder. If the site comes back, reactivate plugins one by one to find the culprit. - Restore the default
.htaccess: in WordPress go to Settings → Permalinks and save without changes to regenerate it. - Check permissions: folders at 755 and files at 644 is the standard safe combination.
Error 502: Bad Gateway
The 502 error appears when an intermediate server (proxy, CDN, or load balancer) receives an invalid response from the origin server. In other words: the request arrived, but the server did not respond correctly.
Most Common Causes
- PHP-FPM process down or overloaded. On hosting with Nginx + PHP-FPM, if the FPM process dies, Nginx returns a 502.
- Timeout exceeded. Scripts that take too long generate a 502 from the proxy before the backend finishes.
- Cloudflare cannot connect to your origin. If you use Cloudflare and your hosting server is unresponsive, Cloudflare returns a 502 to your visitors.
- Shared server saturation. During peak hours, a shared server can run out of available resources.
How to Fix a 502 Error
- Wait 30 seconds and reload: if it is a momentary spike, it usually resolves on its own.
- Check your hosting provider's status page (look for their status page or social media).
- If you use Cloudflare, try accessing your origin IP directly (temporarily bypassing Cloudflare) to determine whether the problem is the CDN or the server.
- Increase the
max_execution_timePHP value if the 502 only occurs on specific scripts. - Consider switching to a VPS plan if the problem recurs during peak hours — shared hosting has limited resources you cannot control.
If the 502 persists and your provider is not responding, a specialized support team can diagnose and resolve the issue much faster.
Error 503: Service Unavailable
The 503 error means the server is reachable but cannot handle the request right now. It is the "temporarily offline" message.
Most Common Causes
- Scheduled maintenance. Some systems activate maintenance mode and return 503 so search engines don't index broken pages.
- Overloaded server. Too many simultaneous connections exhaust the Apache or Nginx worker pool.
- PHP process limit reached. On cPanel/WHM, each account has a limit of concurrent PHP processes.
- Sudden traffic spike (going viral). An unexpected surge in visits can take down a shared plan within minutes.
- WordPress stuck in maintenance mode. An interrupted update leaves the
.maintenancefile active and the entire site returns 503.
How to Fix a 503 Error
- In WordPress, find and delete the
.maintenancefile in your installation root via FTP or the cPanel file manager. - Check whether the maintenance mode of your cache or security plugin is active.
- Review Apache or Nginx logs to confirm whether the server is rejecting connections due to process limits.
- Implement full-page caching (LiteSpeed Cache, W3 Total Cache) to reduce PHP load during traffic spikes.
- If 503 is recurring, consider migrating to a VPS or dedicated-resource hosting plan.
Comparison Table: Differences Between 500, 502, and 503 Errors
| Error | Name | Who fails | Typical cause | Quick fix |
|---|---|---|---|---|
| 500 | Internal Server Error | Your code / config | Broken .htaccess, PHP error, permissions | Check error log, fix permissions |
| 502 | Bad Gateway | Proxy or CDN | PHP-FPM down, timeout, Cloudflare no origin | Wait / upgrade plan / contact support |
| 503 | Service Unavailable | Server (temporary) | Overload, maintenance, stuck .maintenance file | Delete .maintenance, enable cache |
You can compare more options and read detailed analyses in our hosting comparisons section.
Key Takeaways
- Error 500 is almost always a problem in your own code or configuration; the error log is your first tool.
- Error 502 comes from an intermediary (Cloudflare, proxy) that is not getting a valid response from the origin server.
- Error 503 indicates overload or maintenance; in WordPress check the
.maintenancefile first. - All three errors drop dramatically with a solid hosting plan, active caching, and proactive monitoring.
- If the error is recurring, shared hosting may have hit its ceiling — a VPS could be the answer.
Tired of dealing with server errors? The team at elenlace.com can migrate and manage your hosting so these problems stop interrupting your business.
FAQ
Does a 500 error hurt my site's SEO ranking?
Yes, if it persists for more than a few hours. Google can interpret a sustained 500 as an unavailable site and reduce its crawl frequency. If the error is resolved quickly, the impact is minimal. The key is to fix it as fast as possible.
Why does the 502 error only appear when Cloudflare is active?
Because Cloudflare acts as an intermediary between the visitor and your server. If Cloudflare cannot connect to your origin (due to a timeout or server outage), it returns a 502 to users. Accessing your origin IP directly helps confirm whether the problem is Cloudflare or the server itself.
How do I prevent 503 errors during traffic spikes?
Implement full-page caching (LiteSpeed Cache on LiteSpeed servers, or W3 Total Cache on Apache), activate a CDN to serve static assets, and if traffic is structurally high, migrate to a VPS or cloud plan where you can scale resources immediately.
Can I view error logs from cPanel without SSH access?
Yes. In cPanel go to Metrics → Errors to see the latest Apache log entries. For more complete or real-time logs, most providers also allow SFTP access so you can download the error_log file from your account root.
Compare providers
Other providers and guides worth comparing: