How to Fix a 500 Internal Server Error: The Visitor's Checklist and the Owner's Playbook

CodexFuse Team · 2026-10-26T17:13:01.428Z · 12 min read

A 500 Internal Server Error is the server's way of saying "something went wrong, but I can't tell you what." Learning how to fix a 500 Internal Server Error starts with knowing whose job it is: if you are a visitor, it is almost never yours to fix, and a five-minute checklist is all you need. If you own the site, the fix is a logs-first playbook you work through in order, not a guessing game. This guide gives you both — the visitor's checklist first, then the owner's playbook — so neither side wastes time on the other's steps.

Before anything else, confirm the problem is really the site and not your connection. Open another website in a new tab: if it loads, your connection is fine and the 500 belongs to the site. A website uptime monitor gives you the same answer without guessing — it checks the site from outside your network and tells you whether it is responding at all.

What Is a 500 Internal Server Error?

A 500 Internal Server Error is a generic HTTP status code that means the web server ran into an unexpected condition and could not finish your request. It is the most general server error: the server returns it when no more specific error code, such as 502, 503, or 504, applies. The error says nothing about the cause — only that the failure happened on the server's side, not in your browser.

That vagueness is the whole problem. A 404 tells you the page is missing. A 403 tells you access is denied. A 500 tells you only that something failed somewhere between the server receiving your request and sending back a page. Finding the cause means looking at what the server recorded, which is why the owner's fix starts with the error log and never with random changes.

Is the 500 Error Your Fault or the Website's?

The 500 error is the website's fault, not yours. Because a reply came back at all, your connection did its job: you reached the site, and the site then tripped over its own problem. Chrome's own error page says the same thing in plain words — "This page isn't working" and "the site is currently unable to handle this request" — and offers only a Reload button, because there is nothing on your computer to repair.

Three patterns cover most cases. If other sites load and only this one shows a 500, the server behind that site is failing. If the site works until you do one thing — checkout, a file upload, or a login — one function on the server is failing while the rest keeps running. And if nothing loads at all, or the error starts with ERR_ instead of a number, that is not a 500: it points to your connection or a security problem instead. If you want the full test, our guide to check if a website is down walks through telling a dead site from a dead connection.

The Visitor's Checklist: Five Minutes, in Order

If you are the visitor, work this list in order and stop as soon as the page loads. Most 500 errors are temporary hiccups that clear on their own, and the checklist is designed to find that out fast.

  1. Check email or bank first if you clicked Pay or Submit. The server may have finished part of the job before it failed, and a second attempt could repeat the payment or submission. Check your inbox and your bank app before you try again.
  2. Open a different website in a new tab. If it loads, your connection is fine and the problem is the site's.
  3. Press Reload once. A short hiccup on the server can clear on its own. One reload tests whether it passed; ten more reloads cannot repair the server's configuration.
  4. Wait a few minutes, then try again. Fixing a 500 is the site owner's job, and it can take them a while. A few minutes is a fair first gap.
  5. Try another device or browser. If it fails there too, you have confirmed it is the server. Then contact the site's support team with the page address and the time it happened — if the error page shows a request ID, include that, because it helps the owner find the matching entry in the server log.

Clearing your cache and cookies, changing your DNS settings, and reinstalling your browser do not fix a 500 error. The failure happened on the server, not in files your browser stored, so those steps have nothing to act on. DNS only finds the site's address, and a 500 reply proves you already got there.

500 vs 502 vs 503 vs 504: Which Server Error Is It?

Every 5xx code means a server-side problem, but they differ in what went wrong and who can fix it. Knowing which one you are looking at keeps you from chasing the wrong cause.

CodeMeaningWhat it tells you
500 Internal Server ErrorThe server hit an unexpected conditionThe cause is unclear — it needs investigation, usually in the server log
501 Not ImplementedThe server does not support the requested functionThe request method is not allowed or the server is outdated
502 Bad GatewayA proxy or gateway got an invalid response from an upstream serverThe backend server is down, misconfigured, or unreachable
503 Service UnavailableThe server is temporarily unable to handle requestsMaintenance or overload — the server is still running
504 Gateway TimeoutThe server waited too long for another server's responseA backend process or database query is too slow

The practical difference is simple. A 500 is unclear and needs debugging. The other codes are more precise about what went wrong, which makes them easier to troubleshoot. A 500 that appears only on one page or one action — checkout works, login does not — usually means one function on the server is failing while the rest keeps running.

What Causes a 500 Internal Server Error?

There is no single cause, which is what makes the error frustrating. The common culprits fall into a short list, and each one leaves a different trace in the server log.

CauseTypical triggerWhere the answer lives
File permission errorsThe server cannot read a file or enter a directoryError log names the path; files should be 644, directories 755
.htaccess syntax errorA typo or a directive for a module that is not loadedApache error log names the failed directive
PHP or application errorA fatal error, a missing extension, or a memory limit hitPHP error log or PHP-FPM log
Database connection failureThe database service is down or the credentials are wrongApplication log; check the service and the config file
Broken plugin or themeAn update or install that conflicts with the siteError log; disable the most recent change first
Server resources exhaustedMemory or disk space ran out under loadMemory and disk checks on the server
Wrong file ownershipFiles deployed as the wrong user after an upload or a Git pullFile listing shows the owner

Server misconfigurations, programming errors, database problems, and insufficient resources cover nearly every 500 error in practice. Third-party services and APIs can trigger one too, when an integration the site depends on fails or returns something the site cannot handle. Temporary network problems between the client and the server can also produce a 500, though that is the rarest of the list.

The Owner's Playbook: Fix It in Order

If you run the site, do not start by changing things. Start by reading the log for the exact minute the error happened. The log usually contains the exact error message, the file path, and the line number that caused the failure — and that one line often ends the whole investigation.

1. Read the error log first

The fastest way to find the cause of a 500 error is the web server error log. The location depends on your server: Apache on Ubuntu and Debian writes to /var/log/apache2/error.log, Apache on Fedora and Red Hat writes to /var/log/httpd/error_log, and Nginx writes to /var/log/nginx/error.log. On an Nginx and PHP-FPM stack, check both logs — the Nginx log records proxy and transport failures, while the PHP log usually holds the application error itself.

If the log is empty, the application may be writing somewhere else, or PHP-FPM may not be capturing worker output. Check the active PHP-FPM configuration and logging destination before concluding there is no error to find. Never turn on error display in the browser on a live site: printing the error text exposes file paths and configuration details to every visitor, and the log gives you the same information without that risk.

2. Roll back the most recent change

If you just installed a plugin, updated your software, or changed code, reverse that change and test again. A 500 that appears right after a deployment usually means the deployment itself is the cause — deployment tools often write files with the wrong owner, and the web server cannot read files it does not own. Check the ownership of the files under your web root and correct it before touching anything else.

3. Test the .htaccess file

On Apache, one bad directive in .htaccess brings down the whole site. Temporarily rename the file and load the page: if the site works, the problem is inside it. Review it line by line, or check the Apache error log for the specific directive that failed. Remember that renaming disables every rule the file contains, including redirects and HTTPS enforcement, so restore it as soon as you have your answer.

4. Fix file permissions

Incorrect permissions are one of the most frequent causes of 500 errors. Files should be 644 and directories 755 as a rule, and the web server process needs read access to your files and execute access to your directories. Never use 777 — it leaves your files writable by anyone on the server. If the files were just deployed, check ownership first: a correct permission on a file owned by the wrong user still blocks the server.

5. Disable the newest plugin or theme

Content management systems such as WordPress, Joomla, and Drupal often throw a 500 after a plugin or theme update. Rename the plugins directory to disable all plugins at once, then re-enable them one at a time until the error returns. Do this in a maintenance window or on a staging copy: disabling every plugin at once also takes down caching, security, and payment plugins on a live site.

6. Check PHP memory and the database

A fatal PHP error — a syntax error, a missing extension, or an exceeded memory limit — returns a 500 instead of a page. If the error is a memory limit issue, raise the memory_limit value in the PHP-FPM configuration file for your PHP runtime, then restart the PHP service. For the database, check whether the service is running and verify the credentials in your application configuration file, such as wp-config.php for WordPress.

7. Check memory and disk space

Running out of memory or disk space makes the server fail when processing requests. Check available memory and disk space on the server, and clear log files that have grown too large if the disk is full. If a worker process vanished under load, the kernel's out-of-memory killer may have terminated it — the kernel log will confirm that.

8. Restore from backup — then keep investigating

If you are stuck and you have a recent backup, restoring it gets you back online while you investigate on a staging copy. A restore is a recovery step, not a fix: the same cause will return if you never find it. That is why a real backup matters before you need one — learn how to back up your website so the copy you restore is complete, with files and database together. If the server is shared hosting and none of the steps above turn up a cause, contact your hosting provider's support team: they can run server-side checks you cannot see from your account.

500 Error on WordPress? Start Here

WordPress hides fatal errors behind a generic message, so the standard playbook needs two WordPress-specific steps. First, turn on logging: in wp-config.php, change the existing WP_DEBUG value to true and add WP_DEBUG_LOG, so errors land in wp-content/debug.log. Read that file for the failing plugin or theme, then change WP_DEBUG back to false and remove the extra lines — a debug log left enabled on a live site keeps growing and records details about your installation that should not be readable.

Second, work the plugin and theme angle in order. Deactivate the most recently updated plugin first, then switch to a default theme such as Twenty Twenty-Four to rule out the theme. The usual WordPress causes are the same short list: a broken plugin or theme, wrong file permissions, a corrupt .htaccess file, and an exceeded PHP memory limit. A fresh WordPress install restores the default files if core files are corrupt, but back up first — reinstalling without a backup can destroy content you cannot get back.

How to Stop 500 Errors Coming Back

Fixing one 500 error is not the same as preventing the next one. The habits that keep a site stable are unglamorous, and they are the same ones every source in this guide names: keep software and code updated, keep permissions correct, and watch your resources before they run out.

Set up error logging and monitoring, and read the logs regularly so patterns surface before they become outages. A monitoring check that requests your site and verifies the HTTP status code catches a 500 the moment it appears, instead of waiting for a visitor to report it. Google Search Console also reports 500 errors in its crawl data, so a sudden traffic drop is often the first visible sign — knowing how to check website traffic and compare it against the error timeline tells you when the problem started. Test your backups by restoring them, because a backup you have never test-restored is a hope, not a backup. And scale resources before traffic forces the issue: a site that outgrows its hosting plan will keep hitting the same resource wall until the plan changes.

Frequent 500 errors also cost you search visibility. Search engines may lower a site's ranking if they consistently encounter errors, so a 500 that lingers is not just a bad day for visitors — it is a ranking problem that compounds the longer it stays up.

Sources

Every fact in this guide comes from a source fetched on October 26, 2026:

Frequently Asked Questions

What does a 500 Internal Server Error mean?

It means the website's server encountered an unexpected situation and could not display the page. It is a generic server-side error: the server knows something went wrong but cannot be more specific about the cause, so the fix starts with the server's error log.

Is a 500 error my fault as a visitor?

No. A 500 error is the website's problem, not yours. Because a reply came back at all, your connection did its job. The most you can do as a visitor is reload once, wait a few minutes, and report the page address and time to the site's owner.

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

A 500 error means your own web server hit an unexpected condition. A 502 Bad Gateway error means a proxy or gateway server got an invalid response from an upstream server — for example, a backend server that is down or unreachable. The 500 needs investigation in your server log; the 502 points at the connection between servers.

Is a 500 error bad for SEO?

Yes, especially if it happens frequently. Search engines may lower your website's ranking if they consistently encounter errors, so fixing a 500 quickly matters for search visibility as well as for visitors. Google Search Console reports 500 errors in its crawl data, which is one way owners spot them early.

How long should I wait before trying a page with a 500 error again?

A few minutes is a fair first gap — the error is often a temporary hiccup that clears on its own. If the page is still failing later in the day, assume the owner does not know yet and send a report with the page address and the time it happened.