Gateway and server errors such as 502, 503, 504, 500 and 508 all mean the same thing to a visitor: the page did not load. For you they point in different directions, because each code comes from a different part of the chain between the browser and WordPress. This guide explains what each code means on Domain India hosting, how to find the cause, and what you can fix yourself.
Note the exact code and the time it happened, then check the error log and the account's resource usage. A 504 means a request ran too long: on our cPanel servers, nginx stops waiting for the page at 90 seconds, and most sites stop a request even earlier, after about 60 seconds, so long jobs must be made shorter or moved to a scheduled task. A 502 usually means PHP stopped mid-request. A 503 means maintenance mode or a memory or process limit; a 508 means the entry-process limit. A 500 is a code or configuration error. Raising limits rarely helps until you have found what is slow.
1. What each error means
On our cPanel servers a request passes through nginx, then Apache, then PHP running WordPress, which may call the database or an outside service. DirectAdmin servers have no nginx layer; Apache answers directly.
| Code | What it means | Most common cause on shared hosting |
|---|---|---|
| 500 Internal Server Error | The server hit an error while building the page | A plugin or theme error, or a bad .htaccess line |
| 502 Bad Gateway | The layer in front got no valid reply from the one behind it | A PHP process stopped or crashed mid-request |
| 503 Service Unavailable | The site can't serve the request right now | Maintenance mode, or the account's memory or process limit |
| 504 Gateway Timeout | The layer in front waited too long for a reply | A slow import, query, backup or outside API call |
| 508 Resource Limit Is Reached | The account is running as many PHP requests as it is allowed | Slow requests piling up, or bots and login attacks |
Behind Cloudflare? If the error page carries Cloudflare's branding (including codes 520 to 524), the problem may be between Cloudflare and our server.
2. First checks for any of these errors
- Write down the code, the page and the time.Include the time zone. Every other check depends on matching this time.
- Test without the cache.On our cPanel servers, nginx caches successful pages for up to 120 minutes and can hide or prolong an error. Add
?t=and any text to the address, for examplehttps://yourdomain.com/?t=123, to see what the server returns now. - Read the error log.It usually names the plugin, file and line. See reviewing error logs in cPanel and DirectAdmin.
- Check resource usage.In cPanel, open Metrics › Resource Usage and look at the Faults column at the time of the error. See how to check your hosting resource usage.
- Think about what changed.A plugin or theme update, a new PHP version, an import or a marketing email that sent a burst of visitors.
3. 504 Gateway Timeout
A 504 means a request took longer than the layer in front was willing to wait. On our cPanel servers nginx waits up to 90 seconds for Apache to reply, and the default PHP max_execution_time there is 120 seconds. Most sites stop a page request even earlier: PHP-FPM ends it after about 60 seconds with an error, even if PHP would have been allowed to keep going.
That changes the fix. Raising max_execution_time above 60 seconds will not let a web request run longer. Make the work shorter instead:
- Imports and exports. Split large WooCommerce product imports or database imports into smaller files.
- Backups and migrations. Plugin-based backups of large sites often time out. Use JetBackup in your panel for full backups, and your own downloads for extra copies.
- Slow outside services. A plugin that calls a payment, shipping or licence API with no timeout can hold a request for minutes. Give every outbound call a timeout of a few seconds; see my website is slow, section 6.
- Slow queries. Install the Query Monitor plugin, find the slowest queries on the failing page, and fix or remove what causes them.
- Long jobs. Run them from a cron job or, if jailed SSH is enabled on your account, with WP-CLI, rather than from a browser tab.
You can change PHP's own limits in cPanel's MultiPHP INI Editor or with a .user.ini file; see how to edit php.ini in cPanel. The nginx and Apache timeouts are server-wide and can't be changed for one account.
4. 502 Bad Gateway
A 502 means the layer in front received a broken reply or none at all. On shared hosting this usually means a PHP process was stopped part-way through, most often because it ran out of memory or hit a process limit.
- Check the error log for "Allowed memory size exhausted" or a fatal error just before the 502. Memory errors are covered in resolving PHP memory allocation errors.
- Check Resource Usage for memory or process faults at that time.
- If a 502 appears across the whole site for a few seconds and then clears, it may have been a brief service restart on the server. If it keeps coming back with nothing in your logs, open a ticket with the times.
5. 503 Service Unavailable
Stuck in maintenance mode. While WordPress updates, it creates a .maintenance file in the site's main folder and shows "Briefly unavailable for scheduled maintenance". If an update is interrupted, the file stays behind. Delete .maintenance with File Manager or FTP, then re-run the update that failed.
Resource limits. When an account runs out of physical memory or processes, visitors get a 500 or 503. Find the busy URLs at that time and fix the cause: bot traffic, login attacks on wp-login.php and xmlrpc.php, heavy plugins or cron jobs. The full method is in understanding hosting resource limits.
6. 508 Resource Limit Is Reached
A 508 means the account hit its entry-process limit: too many PHP requests running at the same moment. Usually each request is slow, so a few visitors fill every slot, or bots are sending many requests. A bigger plan rarely fixes it until you find what the requests are waiting for. Follow the Resource Limit Is Reached guide and, for WordPress, debugging Resource Limit Is Reached on WordPress.
7. 500 Internal Server Error
A 500 is usually a code or configuration error, not a gateway problem. Two causes are specific to our servers:
- PHP does not run as an Apache module, so a
php_valueorphp_flagline in.htaccessgives a 500. Change the setting in the control panel instead. - On DirectAdmin, an
Optionsvalue in.htaccessother than the allowed ones gives a 500.
Otherwise, turn on the WordPress debug log and disable plugins one at a time. The full walkthrough is in troubleshooting 500 Internal Server Error.
Rename the plugin's folder inside wp-content/plugins with File Manager, for example from slow-plugin to slow-plugin-off. WordPress deactivates it on the next page load. Rename it back once you know whether it was the cause.
8. On your own VPS
On a VPS you control every layer, so you can also change the server settings. Match the timeouts from the front of the chain to the back: the load balancer or nginx proxy_read_timeout, Apache's Timeout, PHP-FPM's request_terminate_timeout and PHP's max_execution_time. The front layer should wait slightly longer than the one behind it. For repeated 502s, check that PHP-FPM is running (systemctl status php-fpm on AlmaLinux or Rocky Linux; the service name includes the version on Ubuntu) and that pm.max_children suits your memory. See tuning Apache and nginx for high-traffic websites.
9. Where Domain India fits, and when to contact us
Our shared hosting runs Apache on CloudLinux, with each account given its own share of CPU, memory and PHP processes. If your site keeps hitting its limits after you have fixed slow plugins, queries and outside calls, a larger plan helps. If you need your own timeouts and full control, a VPS gives you root access; it is self-managed.
- 50 GB NVMe SSD Storage
- 100 GB Monthly Bandwidth
- 5 Websites
- 50 Email Accounts
- 1 vCPU
- 2 GB DDR4 RAM
- 64 GB NVMe SSD Storage
- 2 TB Monthly Bandwidth
Prices on the cards are Domain India list prices and exclude 18% GST.
Contact support when the error continues after these checks, or when there is nothing in your logs. Send the page address, the exact error code, the times it happened and what you already tried. Support is on 24/7 live chat, and tickets get a first response within 15 minutes; there is no phone support.
What is the difference between a 502 and a 504 error?
A 502 Bad Gateway means the layer in front received a broken reply or none, usually because a PHP process stopped mid-request. A 504 Gateway Timeout means the reply took too long, usually because the page was doing slow work such as a large import or a call to a slow outside service.
Why does raising max_execution_time not fix my 504 error?
On Domain India cPanel servers, most sites stop a PHP request after about 60 seconds, and nginx stops waiting for a page at 90 seconds, whatever PHP's own limit is. A request that runs longer than that still ends in an error. Make the work shorter, split it into batches, or run it as a scheduled task instead.
How do I fix "Briefly unavailable for scheduled maintenance" in WordPress?
Delete the .maintenance file in the WordPress site's main folder using File Manager or FTP, then run the update that was interrupted again.
Why does my WordPress site show a 503 or 508 error at busy times?
The account is hitting its resource limits: memory or processes give a 500 or 503, and the entry-process limit gives a 508. Check the Faults column in cPanel's Resource Usage, then look for bots, login attacks, heavy plugins or requests waiting on slow outside services.
Can I restart Apache or PHP on shared hosting?
No. The web server and PHP are shared by every account on the server and are managed by Domain India. If an error persists with nothing in your logs, open a support ticket with the exact times. On a VPS you can restart services yourself.
Ready to fix it? Start with the error log and Resource Usage, work through the section for your error code, and open a ticket with the times if the cause isn't on your side.
Send us the page, the exact error code and the times it happened, and we will check the server side with you.
Open a support ticket