Rescue & repair · Server troubleshooting

Server troubleshooting for errors your website can't fix by itself.

500, 502, 503 and 504 errors, resource-limit warnings, timeouts and slow server response. We read the logs, find what’s failing (PHP, the database, hosting limits or a proxy) and fix the cause.

The path of a web request from browser through DNS, CDN, web server, PHP and database, with the error codes typically produced at each stage
Request path · where errors happen

Is it the website or the server?

In short

Server troubleshooting means finding out why the machine and software that run your website (web server, PHP, database and hosting limits) are failing to serve pages, then fixing the configuration, the code that’s overloading it, or the hosting setup itself.

The fastest way to narrow a problem down is to look at where a request stops. When someone visits your site, the request passes through DNS, often a CDN or proxy, the web server, PHP, and the database. Each stage fails in its own way, and the error code tells you roughly where.

The path of a web request from browser through DNS, CDN, web server, PHP and database, with the error codes typically produced at each stage
Where a request stops tells you what to fix

Server error codes, decoded

CodeWhat it meansCommon causes
500 Internal Server ErrorThe server hit an error it couldn’t handlePHP fatal error, bad .htaccess rule, wrong file permissions
502 Bad GatewayA proxy or CDN got an invalid response from your serverPHP process crashed, server overloaded, firewall blocking the CDN
503 Service UnavailableThe server is temporarily refusing requestsResource limits reached, maintenance mode, PHP workers exhausted
504 Gateway TimeoutThe server took too long to answerSlow database queries, long-running PHP, external API calls hanging
508 Resource Limit ReachedShared-hosting account hit its limitsTraffic spikes, bots, heavy plugins, runaway cron jobs
403 ForbiddenAccess refusedSecurity rules, file permissions, a firewall or .htaccess block
429 Too Many RequestsRate limiting kicked inAggressive bots, misconfigured security tools
520–524Cloudflare-specific errors between Cloudflare and your serverOrigin down, timeouts, SSL mismatch between Cloudflare and host

These are starting points. The server’s error logs tell us which applies to your site.

Resource limits and traffic spikes

Shared and managed hosting plans limit how much CPU, memory, simultaneous processes and file count (inodes) your account can use. When a site reaches those limits, pages slow down and then fail with 503 or 508 errors, often at the busiest times.

Usually something specific is using more than it should: a plugin running heavy database queries on every page, a search feature hit by bots, uncached pages under load, WP-Cron firing on every visit, or an attack hammering the login page. We identify what is consuming resources before recommending a bigger plan. Upgrading hosting hides the problem; it doesn’t always fix it.

Find the consumer

Access logs, slow-query logs and process lists show which pages, bots or tasks use the resources.

Filter bad traffic

Block or rate-limit abusive bots and login attacks before they reach PHP.

Cache properly

Page, object and browser caching so most visits never touch the database.

PHP and web server configuration

Many server errors come down to configuration that no longer matches what the site needs:

  • PHP version. Too old and you’re insecure and unsupported; changed without testing and older code breaks.
  • Memory limit and execution time. Too low and large imports, backups or admin pages fail part-way.
  • PHP workers / processes. Too few and visitors queue behind slow requests, especially on WooCommerce.
  • OPcache. When it’s off or too small, PHP recompiles code on every request.
  • Web server rules. Apache and LiteSpeed read .htaccess; Nginx uses its own configuration. A single wrong redirect or security rule can take a site down or create a redirect loop.

We change one thing at a time, note the previous value, and test after each change, so anything can be undone.

Database problems

“Error establishing a database connection” means WordPress couldn’t reach its database: wrong credentials after a move, a database server that’s down or overloaded, or corrupted tables.

Slower, quieter database problems are more common: tables bloated with old revisions and expired transients, large amounts of autoloaded options loaded on every request, missing indexes, or one plugin running an expensive query on every page. We find them with slow-query logs and query monitoring, then clean up and optimise. We always take a backup first.

Scheduled tasks and cron

WordPress runs scheduled tasks (publishing posts, sending emails, running backups, clearing caches) through WP-Cron, which is triggered by visits rather than a real clock. On quiet sites tasks run late; on busy sites they run too often; and a stuck task can loop and overload the server.

On most production sites we switch to a real server cron job that runs WordPress tasks at a fixed interval, and we check for plugins that schedule more work than they need.

Evidence first

What we look at

  • web server access logs: who requested what, when, and with what response
  • PHP error logs and the WordPress debug log
  • the host’s resource-usage graphs: CPU, memory, processes, I/O
  • slow-query logs and database size
  • CDN or proxy logs (Cloudflare and similar), if you use one
  • recent changes: updates, plugins, DNS, SSL, hosting plan

Then you get a short write-up: what was wrong, what we changed, and anything you should know about your hosting plan.

When it's time to change host

Sometimes the honest answer is that the hosting plan doesn’t fit the site anymore: a busy WooCommerce store on entry-level shared hosting, a host that can’t offer a supported PHP version, or one that won’t give you access to logs. We’ll tell you when that’s the case, explain the options in plain terms, and if you decide to move, handle it as a planned hosting migration.

We don’t receive commissions from hosting companies, so recommendations are based on what your site needs.

What we'll need from you

Hosting control panel or SSH access

cPanel, Plesk, a managed host’s dashboard, or SSH on a VPS.

CDN or proxy access

If you use Cloudflare or similar, so we can see both ends.

When errors happen

Times, pages affected and any pattern, such as busy periods.

Your hosting plan details

Plan name and limits, if you know them.

Frequently asked questions

Yes, as well as shared and managed WordPress hosting. On VPS and dedicated servers we can work at the operating-system and web-server level if you give us SSH access.

Sometimes it is, sometimes it’s the hosting configuration, and often it’s both. Logs and resource graphs settle the question, and we’ll show you the evidence either way.

Usually not. Most investigation is read-only. If a change needs a short interruption, we’ll schedule it for your quiet hours and tell you first.

Yes. 52x errors usually mean Cloudflare can’t get a good response from your server, which can be an origin problem, an SSL mode mismatch or a firewall blocking Cloudflare.

We recommend based on your site’s needs and budget, and we don’t take referral commissions.

Tell us what you're seeing. We'll tell you what it is.

info@webexpert.solutions · +92 345 7723858 · Faisalabad, Pakistan · Serving the UAE, US, UK & Canada