What Is a 500 Internal Server Error?

A 500 is the server saying 'something went wrong' and refusing to say what. The 'what' is in a log file, and the fix is almost always the last thing someone changed.

What Is a 500 Internal Server Error? — Troiana insight cover

In short

A 500 Internal Server Error is the generic response a web server sends when something on the server side failed and no more specific status applies. The visitor cannot fix it. On a typical site the cause is a recent change: a plugin or theme update, a broken deploy, a syntax error in a configuration or PHP file, a missing dependency, wrong file permissions, an exhausted memory limit, or a database that stopped responding. The real error message is in the server's error log or the application's log, and reading it usually identifies the fix in minutes.

What it means

HTTP status codes in the 500 range mean the server, not the visitor, has the problem. 500 is the catch-all: the server tried to handle the request, something failed, and it has no more specific code to give. By design the public page says nothing useful, because the details could expose how the server is built. The details exist; they went to a log.

So the 500 page is a symptom. The diagnosis is elsewhere.

The usual causes

A recent change. By far the most common. A plugin or theme update on WordPress, a deploy with a bug, a change to .htaccess or another configuration file, a PHP version change by the host, an edited template with a syntax error. If the site worked yesterday, the question is what changed today.

A syntax or runtime error in the code. A missing bracket, an undefined function, a fatal exception. On PHP sites this often shows as a white screen or a 500 depending on error display settings.

A bad .htaccess. A single invalid directive in an Apache .htaccess file makes every request return 500. Plugins and hosts write to this file; corrupted or conflicting rules are a classic cause.

Memory limit exhausted. PHP has a memory limit per request; a heavy plugin or a large image processing job exceeds it and the request dies.

Wrong file permissions or ownership. After a migration or a manual upload, files the server cannot read or directories it cannot write produce 500s.

Database problems. The database server is down, out of connections, or the credentials in the configuration are wrong. WordPress shows its own "error establishing a database connection" page for this; other applications return 500.

Missing dependencies. A deploy that did not install packages, a PHP extension the host removed, a Node module absent from production.

Resource limits on shared hosting. The account exceeded its CPU or process limit and the host is refusing requests. Some hosts return 500 for this, others 503.

Timeouts upstream. If a proxy is involved, a slow application can surface as 500, 502 or 504 depending on configuration.

Where the real error is

Server error log. On Apache, error_log in the site root or under /var/log/apache2/; on Nginx, /var/log/nginx/error.log; on cPanel hosting, the Errors section of the control panel. The most recent entries at the time of the failure name the file and line.

Application log. Laravel writes to storage/logs; Django and Rails to their configured log; Node applications to wherever the process manager captures stdout. Platforms such as Vercel, Render and Fly show logs in their dashboards.

WordPress debug mode. Setting WP_DEBUG and WP_DEBUG_LOG in wp-config.php writes errors to wp-content/debug.log. Turn it off again afterwards.

Browser developer tools show the status and headers but rarely the cause; the network panel confirms it is a 500 rather than a blocked request or a certificate problem.

Never leave detailed errors displayed on the public page; read them from the log.

The diagnosis in order

  1. Confirm it is a 500 and whether it affects every page or one. Every page points to configuration, .htaccess, the database or a fatal error in shared code; one page points to that page's code or content.
  2. Ask what changed. Updates, deploys, edits, host notices. Undo the most recent change: restore the previous version, disable the plugin by renaming its folder over FTP, revert the deploy. If the site recovers, you have found it.
  3. Read the error log for the timestamp of the failure. The message usually names the file, the line, and the problem.
  4. Check .htaccess by temporarily renaming it. If the site comes back (without pretty URLs), the file is the problem; restore it and remove the bad rule.
  5. Check the database: is it running, are the credentials right, is it out of connections or disk.
  6. Check limits: PHP memory, execution time, hosting resource usage.
  7. Check permissions if the site was recently moved or files were uploaded manually.
  8. Contact the host with the exact time, the log entries, and what you have tried, if the cause is on their side.

Most 500s on small sites are resolved at step 2 or 3.

Preventing the next one

Stage changes before applying them to production, or at least back up first so undoing is a restore rather than a rebuild. Keep the deploy process reversible. Set up error tracking so that a 500 alerts someone with the stack trace attached, rather than waiting for a visitor to report a blank page. And read the log before touching anything, because the log has already done the diagnosis.

A 500 is one of several ways a site can appear down; it is the one that most reliably has a written explanation waiting. If yours does not, or the log is unreadable, book a call and we will find it with you.

Common questions

How do I fix a 500 Internal Server Error on my website?

Undo whatever changed most recently: a plugin or theme update, a deploy, a configuration edit. Then read the server error log or application log for the exact message at the time of the failure, which names the file and cause. Common fixes are restoring a previous version, removing a bad .htaccess rule, raising the PHP memory limit, correcting file permissions, or restarting the database.

Is a 500 error my fault or the website's?

The website's. Status codes in the 500 range mean the server failed to handle a request that was valid. As a visitor there is nothing to fix; reloading occasionally helps if the problem was momentary. As the site owner, the cause is on the server and the details are in its logs.

Where do I find the error log for a 500 error?

On Apache, error_log in the site root or under /var/log/apache2/; on Nginx, /var/log/nginx/error.log; on cPanel hosting, the Errors tool in the control panel; for applications, their own log such as storage/logs in Laravel. WordPress can write errors to wp-content/debug.log when WP_DEBUG_LOG is enabled. Look at entries timestamped to the failure.

What is the difference between a 500 and a 502 error?

A 500 means the server itself hit an error while handling the request. A 502 Bad Gateway means a server acting as a proxy or gateway received an invalid response from the server behind it, typically because the application process is down or crashed. Both are server-side; a 502 points specifically at the layer behind the proxy.

Can a plugin cause a 500 error on WordPress?

Yes, and it is the most common cause. A plugin update with a fatal error, a conflict between plugins, or a plugin exceeding the memory limit takes the whole site down. Disable plugins by renaming their folders over FTP or the file manager, one at a time or all at once, and restore the site; then update or replace the culprit.

Have something worth building right?