How to Fix the 500 Internal Server Error

A 500 Internal Server Error is a generic message that means the server hit a problem but can't say exactly what. The real cause is usually in the error log. Most often it is a corrupted .htaccess file, an exhausted PHP memory limit, or a plugin or theme conflict, and each is fixable in minutes.

Key takeaways

  • A 500 error is server-side and vague on purpose; the detail lives in your error log, not on the screen.
  • The five usual causes are a broken .htaccess, a hit PHP memory limit, a plugin or theme conflict, wrong file permissions, or corrupted core files.
  • Back up first, then work through the steps one at a time so you know which change fixed it.
  • Rename .htaccess, raise the memory limit, and deactivate plugins in that order — they solve most cases.
  • If nothing on your side changed and other sites on the same server are down too, it is your host's problem, not yours.
Disclosure: Some links on this page are affiliate links. If you buy through them, we may earn a commission at no extra cost to you. We only recommend what genuinely helps with this page's problem, and our guidance stays the same either way.

"My whole site just shows a 500 error"

You loaded your website and instead of your pages you got a blank screen that says 500 Internal Server Error, HTTP 500, or The server encountered an internal error. Maybe it happened right after you installed a plugin, edited a file, or updated something. Maybe it appeared on its own. Either way, the site is offline and you want it back.

Take a breath — this is one of the most common hosting errors, and it is almost always fixable in a few minutes once you find the cause. This guide is for site owners on shared or WordPress hosting who have access to a hosting control panel or FTP (a way to move files to and from your server). It is part of our wider server errors guide, which covers the whole 5xx family.

How to tell what's causing it

Before you change anything, answer three quick questions. Your answers point straight at the likely cause and save you from guessing.

Does it happen on every page or just one? A site-wide 500 usually points to .htaccess, the PHP memory limit, or a broken plugin. A 500 on a single page or action often points to one specific script or a permissions problem on one folder.

Did it start right after a change? If the error appeared just after you updated WordPress, installed a plugin, switched themes, edited .htaccess, or changed your PHP version (the version of the language your site runs on), that change is your prime suspect. Undo it first.

What does the error log say? This is the single most useful step. Open your hosting panel and look for Error Logs (in cPanel and hPanel it sits under "Metrics" or "Advanced"). On WordPress you can also switch on logging by adding define('WP_DEBUG_LOG', true); to wp-config.php, then reading the file it writes to wp-content/debug.log. The log names the file and line that failed, which turns a mystery into a to-do.

Is it your site or your host? Here is the clean test. If the 500 hits only your site and started after you changed something, it is your site — work through the steps below. If your site was untouched, other sites on the same server are also failing, or the error comes and goes with no change from you, it is likely a server problem and you should contact your host. When the whole server is overloaded you may see a 502 Bad Gateway instead, which is a closely related host-side error.

What's actually happening

Every time a browser asks for a page, the server answers with a three-digit HTTP status code — a short number that says how the request went. Codes in the 500 range (5xx) all mean "the server had a problem." The 500 Internal Server Error is the most generic of these: the server knows something went wrong while building your page, but it either can't or won't say exactly what on the public screen.

That vagueness is deliberate. Showing the raw error to every visitor could leak file paths and other details an attacker could use, so the server hides the specifics and shows a plain 500 instead. The specifics are written to your error log — a private file where the server records what really failed. That is why the log is the fastest route to a fix: the screen says "something broke," and the log says "this exact file broke on this line."

So the 500 is a symptom, not a diagnosis. Your job is to work out which underlying cause triggered it.

Your options at a glance

A 500 error has six common causes. Match your situation to the likely one, then follow the ordered steps in the next section — they walk through all six from easiest to hardest.

Likely cause Typical sign Fix it in
Corrupted .htaccess fileWhole site down, often after a plugin or permalink changeStep 3
PHP memory limit exhaustedError on heavy pages; log says "allowed memory size exhausted"Step 4
Plugin or theme conflictStarted right after an install or updateSteps 5–6
Wrong file or folder permissionsLog mentions "permission denied"Step 7
Corrupted core filesError remains after all other fixesStep 9
Incompatible PHP versionStarted after a PHP version changeStep 8 log

How to fix it, step by step

Work through these in order. Test your site after each step — the moment it loads again, the last change you made was the cause. Stop there.

  1. Back up your site first. Before you touch anything, make a full backup of your files and database so any mistake is reversible. Most panels have a one-click backup, or you can copy your files over FTP. See our website backups guide if you are not sure how.
  2. Reload the page and clear your browser cache. A 500 error is sometimes transient — a brief server hiccup. Wait a minute, then reload with Ctrl+F5 (or Cmd+Shift+R on Mac) to bypass your cache. If the site returns, you are done.
  3. Check and regenerate your .htaccess file. The .htaccess file is a small server config file in your site's root folder; one bad line takes the whole site down. Using File Manager or FTP, rename .htaccess to .htaccess_old and reload your site. If it works, the old file was the culprit. In WordPress, generate a clean one by going to Settings → Permalinks and clicking Save Changes without editing anything.
  4. Increase the PHP memory limit. If the log says "allowed memory size exhausted," your site ran out of the memory its plan allows. Raise it by adding define('WP_MEMORY_LIMIT', '256M'); to wp-config.php, or set memory_limit = 256M in your panel's PHP settings. Our PHP settings guide shows exactly where each option lives.
  5. Deactivate all plugins, then reactivate one by one. A single plugin can trigger a 500. If you can't reach wp-admin, use File Manager or FTP to rename the wp-content/plugins folder to plugins_old — this switches every plugin off at once. If the site returns, rename it back, then enable plugins one at a time, reloading after each, until the error reappears. That plugin is the problem.
  6. Switch to a default theme. If plugins were not the cause, your theme might be. Activate a default theme such as Twenty Twenty-Four from Appearance → Themes, or rename your active theme's folder over FTP to force WordPress onto a default. If the 500 clears, the fault is in your theme.
  7. Check your file permissions. Permissions control who can read or run each file. Wrong values cause a 500. In your File Manager, set folders to 755 and files to 644. Never set anything to 777 — it lets anyone write to the file and is a serious security risk.
  8. Turn on WP_DEBUG and read the error log. If the cause is still hidden, add define('WP_DEBUG', true); and define('WP_DEBUG_LOG', true); to wp-config.php, reload the failing page, then open wp-content/debug.log. It names the exact file and line — including whether an incompatible PHP version is to blame — so you know precisely what to fix.
  9. Reinstall fresh core files. If the log points to a damaged system file, your core files may be corrupted. Download a clean copy of WordPress, then upload only the wp-admin and wp-includes folders over the top of the old ones via FTP. This replaces the engine without touching your content, plugins, or uploads.
  10. Contact your host. If nothing on your side changed, the log points at the server, or other sites on the same server are affected too, the problem is host-side. Send your host the exact error and timestamp so they can check the server. This is the right move for a genuine server-side error.

Common mistakes to avoid

Warning: Never edit .htaccess or wp-config.php without a backup, and never set files or folders to 777. A single wrong character in these files can take the whole site down, and 777 permissions let anyone on the server write to your files.

Editing config files with no backup. People often open .htaccess or wp-config.php, make a change, and have no way back when it breaks. Always copy the file first (Step 1). A backup turns a disaster into a two-minute undo.

Using 777 permissions to "just make it work." Setting everything to 777 can clear a permissions 500, but it opens your site to attackers. Stick to 755 for folders and 644 for files — that is both correct and safe.

Assuming it's a plugin when the log says otherwise. It is tempting to disable plugins and hope. But if the error log points at a memory limit or a permissions problem, chasing plugins wastes time. Read the log first, then fix what it actually names.

How to prevent it in future

Test changes on a staging site. A staging site is a private copy of your live site where you can try updates safely. Update plugins and themes there first, confirm nothing breaks, then push the change live. Most good hosts include one-click staging.

Update carefully and one thing at a time. When you update plugins, themes, or WordPress, do it in small batches and check the site after each. If a 500 appears, you will know exactly which update caused it.

Give your site enough resources. Many 500 errors are really memory or resource limits being hit. Keep a comfortable PHP memory limit and make sure your plan has room for your traffic and plugins. Our PHP settings guide covers the numbers that matter.

Keep PHP current. Running a supported, up-to-date PHP version avoids compatibility 500s and keeps your site faster and safer. Check your host's PHP selector every few months.

Frequently asked questions

What does a 500 Internal Server Error mean?

It means the server ran into a problem while building your page but can't say exactly what on the public screen. It is a generic 5xx (server-side) status code. The real cause — a bad .htaccess, a memory limit, a broken plugin, and so on — is written to your error log.

Is a 500 error my fault or my host's?

Usually yours, because it is most often triggered by something on your site, such as a config file, plugin, or memory limit. It is your host's problem when nothing on your side changed, the error is intermittent, or other sites on the same server are failing too. The error log tells you which.

How do I find the real cause of a 500 error?

Read your error log. Open Error Logs in your hosting panel, or switch on WordPress logging by adding define('WP_DEBUG_LOG', true); to wp-config.php and reading wp-content/debug.log. The log names the exact file and line that failed, which points straight at the fix.

Why does the .htaccess file cause a 500 error?

The .htaccess file gives the server line-by-line instructions, and the server refuses to run if any line is invalid. A bad plugin rule, a broken redirect, or a stray character is enough to return a 500. Renaming the file to .htaccess_old disables it so you can test, then Settings → Permalinks → Save rebuilds a clean one in WordPress.

Will a 500 error fix itself?

Sometimes. If it was a brief server hiccup or a short traffic spike, reloading after a minute may clear it. But if it stays after a reload, something is genuinely broken and it will not fix itself — you will need to work through the steps above to find the cause.

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

A 500 means the server itself hit an internal problem while building your page, often caused by your site's own code or config. A 502 Bad Gateway means one server got an invalid reply from another server it relies on, which is more often host-side. If you see a blank white page with no error text at all, that is usually the WordPress white screen of death, a close cousin of the 500.

Summary

A 500 Internal Server Error is the server's way of saying "something broke" without the details — and the details are waiting in your error log. Back up, then work through the fixes in order: reload, regenerate .htaccess, raise the memory limit, disable plugins and the theme, correct permissions, read the debug log, refresh core files, and only then call your host. One of these clears almost every case. To keep it from happening again, browse the rest of our server errors guide, which walks through each related 5xx problem and how to prevent it.

When a 500 keeps coming back because of resource limits

If you have fixed the .htaccess, disabled the guilty plugins, and raised the memory limit, but the 500 keeps returning whenever traffic climbs or your log keeps reporting exhausted memory, you have hit a real ceiling: your current plan cannot give your site the resources it needs. That is one of the few 500 causes that is genuinely host-bound rather than a config you can fix. In that situation a better-resourced host removes the ceiling, and you can compare plans to see whether Hostinger fits your needs. If valid at checkout, new users may be able to apply a code such as SPECIAL15 or SPECIAL10, subject to Hostinger's terms.

Compare Hostinger plans →

Affiliate disclosure: if you sign up through this link we may earn a commission, at no extra cost to you. How this works.

When changing hosts won't fix this. A 500 error is usually caused by something inside your site — a faulty plugin or theme, a broken .htaccess rule, or an exhausted PHP memory limit. Move that same site to a new host and the error moves with it. Treat hosting as the cause only when 500s appear as traffic rises, when you are hitting hard resource limits, or when your host cannot show you the error log. Any decent host will raise a memory limit on request. Diagnose first, and migrate only if the evidence actually points at the server.

Keep reading

Because a corrupted .htaccess is a common cause, it helps to know how to manage your site files with the File Manager, FTP and .htaccess.

References

  • WordPress Developer Documentation — Debugging in WordPress (WP_DEBUG, WP_DEBUG_LOG).
  • WordPress Support — Common WordPress Errors and htaccess reference.
  • PHP Manual — Runtime Configuration (memory_limit).
  • MDN Web Docs — HTTP response status codes (500 Internal Server Error).
Bitrich777 Hosting Team
About the author

The editorial team behind the Bitrich777 Hosting Help Center — practical, tested guides on web hosting, WordPress, servers, DNS, SSL, email, security and migration. Every walkthrough is reproduced on a live host before it is published.

Spotted an error? Tell us