← Back to blog
Hosting and WordPressHosting and WordPress

How to Fix a 500 Internal Server Error on Your Website

A 500 error tells you something broke on the server, but not what. Work through these checks in order.

A 500 internal server error means the server tried to load your page and failed, without saying why. It is a problem on the website's side, not on the visitor's phone or network.

The causes are usually few. Work through these checks in order, and take a backup before you change anything. (No backup yet? Start with how to back up a WordPress website.)

If you are a visitor

There is little you can do. Reload the page, try again in a few minutes, and tell the site owner if it continues.

The rest of this guide is for site owners.

1. Ask what changed

Most 500 errors start right after a change: a plugin or theme update, an edit to a file, or a new piece of code. If you know what you did last, undo that first.

2. Read the error log

The log names the file and line that failed, which saves guessing.

  • In cPanel, open Errors under Metrics.
  • Or look for a file named error_log in public_html using File Manager.

Read the most recent entries. Words such as "memory", ".htaccess" or a plugin's folder name point to the checks below.

3. Check the .htaccess file

A broken .htaccess file is a very common cause.

  1. In File Manager, turn on Show Hidden Files in Settings.
  2. Find .htaccess in public_html.
  3. Rename it to .htaccess_old.
  4. Reload your site.

If the site comes back, the file was the problem. In WordPress, go to Settings, then Permalinks, and click Save Changes to create a clean one.

4. Turn off plugins

If you can reach the WordPress dashboard, deactivate all plugins, then turn them on one at a time until the error returns.

If you cannot log in:

  1. In File Manager, open wp-content.
  2. Rename the plugins folder to plugins_off.
  3. Reload the site.

If it loads, rename the folder back and rename each plugin's folder in turn to find the one at fault.

5. Switch the theme

Rename your active theme's folder inside wp-content/themes. WordPress falls back to a default theme if one is installed. If the site loads, the theme is the cause.

6. Raise the PHP memory limit

If the log mentions memory, your site needs more than it is allowed.

  • In cPanel, open Select PHP Version or MultiPHP INI Editor and raise memory_limit to 256M.
  • Or add this line to wp-config.php, above the line that says to stop editing: define('WP_MEMORY_LIMIT', '256M');

7. Check the PHP version

An old plugin can fail on a new PHP version, and a new plugin can fail on an old one. In Select PHP Version, try the version your site was using before the error began.

8. Check file permissions

Wrong permissions stop the server reading your files. The usual settings are:

  • folders: 755
  • files: 644

In File Manager, right-click a file or folder and choose Change Permissions.

9. Restore a backup

If nothing above works and the site was fine yesterday, restore yesterday's backup. This is often the fastest fix when the site earns money.

10. Contact your host

Send them the time the error began, what changed just before, and the lines from the error log. Sometimes the cause is on the server itself, and only the host can fix that. Our guide to common hosting problems in Nigeria covers the other usual suspects.

How to prevent the next one

  • Update plugins one at a time, not all at once.
  • Keep automatic backups, and test a restore.
  • Remove plugins and themes you do not use.
  • Make changes on a staging copy first, if your host offers one.

If the site loads but crawls, that is a different problem: see why a website is slow and how to fix it.

A related point about domains

A 500 error is a hosting problem, not a domain problem. If your site shows "server not found" or a parked page, check your domain instead: confirm it has not expired and that its nameservers still point to your host. Here is what happens when a domain name expires.

Get more stories like this

Enter your email to get practical guides for running an online business in Nigeria.

You can unsubscribe at any time. Learn more about our Privacy Policy