If you’ve used the internet for more than a week, you’ve seen an HTTP 500 error or Internal Server Error. The error crops up everywhere, and as a visitor to a site, there isn’t anything you can do about it.
But if the error crops up on your site, it’s a problem.
Luckily, we have a solution!
Well, honestly, we have several solutions to the WordPress 500 error problem. There are several because it’s impossible to know exactly what’s causing an HTTP 500 error.
What to Check to Solve an HTTP 500 Error
Imagine that your car breaks down, and you have it towed to your favorite mechanic. The mechanic opens the hood and pokes around and says, “Oh, yeah, there’s definitely something wrong here.” When you ask what, exactly, is wrong, the mechanic says, “Yeah, well, I don’t know, but it’s something.”
That’s what an HTTP 500 error is. A mechanic (also known as a web server) who doesn’t know what’s wrong.
It’s the webserver telling you that something – technically, “an unexpected condition” – prevented it from completing your request. The 500 is simply a web server status code. Every time you load a web page, the server processes the request and sends back a status code. So even when a page loads properly, with no errors, a status code is returned from the server.
The HTTP 500 error means, specifically, the server encountered an unexpected condition that prevented it from fulfilling the request.
Since we’re talking about WordPress, the possibilities for what could be wrong are thankfully (usually) limited. Let’s look at the causes of the HTTP 500 error, or Internal Server Error, on a WordPress site. And more importantly, let’s explore the possible solutions.
What Did You Just Do?
No, really, what did you just do?
If you experience an error after installing a plugin or uploading a file or changing a setting, start there. I know that sounds obvious, but even the best of us can overlook, or live in denial of, self-inflicted errors.
Uninstall the plugin, delete or revert the file, roll-back the setting. If the error disappears, you’ll have to take another approach to whatever you were doing. It’s not as far-fetched as it sounds.
Plenty of WordPress plugins can break your site the minute they’re activated.
If you didn’t do anything that may have caused the error, try waiting a minute and reloading the page.
That may also seem obvious, but the cause of the error could be a temporarily overloaded server. If you wait a minute and reload, the page may pop back up.
You might also try opening the page or site in another browser, or clearing your browser cache. I wouldn’t recommend clearing browser cache as one of your first troubleshooting attempts. Depending on your browser, clearing cache can eliminate a lot of useful everyday shortcuts and URL autocompletes.
Before moving on to a more involved fix, try the Down for Everyone or Just Me website. It’s a simple tool that checks the HTTP status code returned from the server.
If the code returned is anything other than 200, the site will return a “down” result. In which case, it’s time to get to work on a fix.
Those are the easiest troubleshooting and fixes. Now let’s move on to the more elusive ones.
What Causes the WordPress HTTP 500 Error?
Finding the cause of a persistent internal server error on a WordPress site is a process of trial and error. There are six things we’re going to try, but first, let’s turn on debugging to give ourselves some clues.
- Turn On Debugging
- Check the .htaccess File
- Deactivate Any Plugins (All of Them)
- Try a Different Theme
- Replace the WordPress Core Files
- Check WordPress Memory
1. Turn On Debugging
You can turn on debugging in the wp-config file and log all errors, notices, and warnings to a file called debug.log in the wp-content directory. This file is located in the root of your WordPress file directory and contains your website’s base configuration details, such as database-connection information.
You can edit it from there, or download, edit, and then upload it back. Your choice.
Insert the following code into the wp-config to accomplish the above. This code will also hide the errors so they do not interrupt page generation.
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]// Enable WP_DEBUG mode
define( ‘WP_DEBUG’, true );
// Enable Debug logging to the /wp-content/debug.log file
define( ‘WP_DEBUG_LOG’, true );
// Disable display of errors and warnings
define( ‘WP_DEBUG_DISPLAY’, false );
@ini_set( ‘display_errors’, 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( ‘SCRIPT_DEBUG’, true );[/ht_message]
2. Check the .htaccess File
You can check the .htaccess file for any errors once you locate it. The WordPress .htaccess file is found in the root of your WordPress install. This means you will need to access your cPanel.
The file is usually hidden because it is so important. WordPress wants to keep it safe from being accidentally deleted. You will need to do a couple of things to find it. These are general instructions for cPanel, and may differ slightly based on your host but will work the same.
Access File Manager in cPanel: Once in your cPanel, click on the file manager link and head over to your files. Once inside, you need to make the .htaccess file visible.
Make .htaccess File Visible: To do this, click on “Settings.” This is usually located up in the right-hand corner of the cPanel File Manager area. As soon as you select Settings, a popup window will appear. From there, select the option “Show Hidden Files.”
Now, go back to the public_html folder and the .htaccess will should be visible.
From here, you can edit the .htaccess file using one of three methods. Whatever you are most comfortable with is the one you should go with.
- Edit .htaccess WordPress File from cPanel
- Edit .htaccess WordPress File using FTP Client
- Use WP htaccess Editor plugin to edit the file
Note: Before doing any of the above, always make a complete backup of your WordPress website. Just in case something goes wrong.
3. Deactivate Plugins (All of Them)
You can also try and fix an HTTP 500 error by deactivating plugins. You can choose to deactivate them one by one or deactivate all of them. Both ways work.
If you deactivate them all at once, then activate them one by one and look for the error. When you see it, you will know that it is that plugin causing the issue.
4. Try a Different Theme
Oftentimes an HTTP 500 error can be caused by theme conflicts. You can try to fix the errors within the theme, but that can get complicated depending on the theme you are running and what needs to be done.
For an easier fix, try using another theme and see if that fixes the problem. WordPress has no shortage of amazing themes available for use. You can also use a page builder like Elementor to make the site look like you want using another layout.
5. Replace the WordPress Core Files
This is actually not as complicated as the title suggests. In reality, you are simply installing WordPress again so you can have a fresh start. There are some different choices when it comes to installing a fresh copy of WordPress.
- You can install WordPress manually
- Install WordPress using a one-click installation method
- You can also use an FTP client as well (most complicated way)
- You can re-install WordPress from the Update page.
6. Check WordPress Memory
Another option to look into in order to fix an HTTP 500 error is the WordPress memory. You can check the memory and define it to what you might need using multiple options. Remember, if this part is too complicated for you, then have your web host help you.
Here are some ways you can check WordPress memory.
Edit the php.ini File
You need access to the php.ini file. Change this line. If your line shows 64M try 128M:
memory_limit = 128M
*M stands for Megabytes.
Edit the .htaccess File
If you don’t have access to .ini or the above method has failed, then try adding this to the .htaccess file:
php_value memory_limit 128M
.htaccess file is located in the root directory of your WordPress installation. You can access it using the instructions above.
Edit wp-config File
Add this to the top of the file, before the line that says, “Happy Blogging”
define (‘WP_MEMORY_LIMIT’, ‘128M’);
wp-config file is located in the root directory of your WordPress installation.
Change Your PHP Version
Some hosting providers set specific memory limits and force you to use a certain version of PHP. You can usually change this in your cPanel if you know-how. In fact, GreenGeeks lets you change the PHP version quite easily.
However, the easiest thing to do is to contact the support team of your hosting account and have them change or update the PHP version for you.
That’s it. Those are the steps and processes you have at hand to help get your errors fixed. If none of these work, then you need to contact your hosting provider.
Final Thoughts
The HTTP 500 error is annoying, but it doesn’t mean that your site has fully collapsed around you. You have several options at your disposal. Trying them should get you the fix. There are so many things that the error could be, that options for fixing it are readily available.
Again, if you have any issues with the fixes above, then get in contact with your hosting provider and have them help you.