As a web admin, it can be very frustrating to run into issues while on your site. There are several errors a website can encounter, but the 500 Internal Server Error, in particular, is nerve-wracking because there is no stated cause and solution on how best you can fix the error.
Even though this error can be a menace, the bright side is that, with good troubleshooting, you can fix the server error. Navigating through this can be tedious, but; in this article, we would show you different ways to go about troubleshooting and fixing this error.
Of many issues one can encounter while using a website, the most common is the 500 internal server error. The error message comes in different formats, depending on the website or browser you are using. In some browsers, it appears as either an HTTP Error 500 or an HTTP 500 Error. Some other browsers present the error messages differently.
Unfortunately, unlike other error messages that provide details about the error and steps showing how to clear the error messages, the 500 Internal server error does not do that. There are even cases where you would not see an error message. What would appear on your screen is a white blank page popularly known as the White Screen of Death (WSoD). In most cases, when this happens, you won’t be able to figure out what exactly the problem is unless you troubleshoot.
How do you clear the error?
Trying to fix a 500 Internal server error is like trying to treat pain without knowing what part of the body is aching. There are several causes of this error, so, to get a solution, you would have to troubleshoot. But before going ahead to troubleshoot, a way to start is to find out if the error is only happening at your end or if other site users are experiencing the same issue. The ‘Down for Everyone or Just Me’ site is a great place to find this out. You can find out by entering your URL into the website.
Once you find out if the error is unique to you or a general issue, you can begin to figure out the cause of the problem by troubleshooting. The aim is to fix the error as efficiently and timely as possible. You don’t want an error message delaying you while you use your website.
8 Ways to Fix the 500 Internal Server Error
Once you see the 500 Internal Error message pop up on your screen and you have determined it is a general or unique issue with your WordPress website, the next thing to do is troubleshoot.
Just before troubleshooting, it is very vital to back up your WordPress site. The reason is simple. Most of the methods involve modification of your site’s root directory. So, to avoid losing important data on your site, a back-up is necessary.
Once you have your data safely backed-up, you can now move on to troubleshooting. The following are different ways you can fix a 500 internal server error.
1. Activate Debugging
Like we earlier stated, the frustrating aspect of encountering an internal server error is the inability to detect the root cause because of a lack of tangible information. This problem can be annoying when you deal with a WSoD; you would see a blank page with no extra clue as to what is wrong.
Activating the debugging mode on your WordPress website; however, can help you have a better understanding of what might have caused the error. You can enable it by editing your wp-config.php through a File Transfer Protocol (FTP) client. There are several FTP clients to use like; FileZilla, CuteFTP, JSCAPE, etc. You can also do that using File Manager in cPanel, but that depends on your hosting provider.
Once you can locate the file, search for ‘WP_DEBUG.’ After you find it, you can change its value to ‘true.’
Once you have edited the file name, ensure that you save your file then reload your site to check if it worked. If it worked, you would see an error message instead of a blank screen. This error message would contain a line of code that can lead you to locate and fix the problem.
After trying this method, and the server error has not cleared, you would have to change the ‘WP_DEBUG’ value back to false and try out the next solution.
2. Disable the Plugins on Your WordPress
A problem with one of your plugins could be the reason you are getting an internal server error message. To check if this is the cause, you can disable your WordPress plugins temporarily. After doing this, if you clear the error, then the problem might have been from one of your plugins.
You can deactivate your WordPress plugin in two ways; through your WordPress admin screen or FTP or File Manager.
Through the WordPress admin screen, you can disable all plugins by going to the Plugins menu, select all Plugins by checking the box then click on Deactivate from the Bulk Actions drop-down menu. You would need access to your WordPress admin screen to do it this way.
If you do not have access to your admin dashboard, you can also deactivate plugins through FTP or File Manager. Once you get to your site’s root directory, locate the wp-content folder, right-click on the plugins folder, select Rename, then change it to either ‘plugin-old’ or ‘plugin-deactivated.’
It is essential to know that disabling your plugins would not delete them or get rid of your data. This action stops the plugin code responsible for the internal server error from running.
After disabling your plugins, go back to your site to check if the error has cleared. If you were successful, that means one of your plugins was faulty. You have to find out the plugin and fix it. You can figure this out by activating your plugins one after the other and reloading your site to find out which plugin is responsible for the error message.
When you find out the plugin triggering the internal server error, you can either update it, delete it or contact your web developer for assistance on how to handle the faulty plugin.
3. Set a Default WordPress Theme
Another probable cause of an internal server error could be from the WordPress theme the site is using. A faulty WordPress theme can cause an internal server error. If you encounter an internal server error after you just updated your existing website theme; or; you recently switched themes, try switching up your site theme and see if the error message clears.
If you have access to your admin dashboard, locate Appearance, then Themes. You can then activate the default theme or select a new one.
If you do not have access to your admin dashboard, you can change your site’s theme by connecting through FTP. Locate ‘wp-content’; then navigate the themes folder. Navigate the current theme’s folder, edit the name by adding “deactivated” at the end. Doing this would reset the theme to the default theme.
After resetting or changing the theme, reload the site to check if you have fixed the error. If you have rectified the error, you need to get a new theme or possibly, reach out to the author of the theme you were using to notify them of the issues; so, they can work on it.
However, after changing the theme and the error still hasn’t cleared, you can go back to the theme you were using and try out another method to resolve the issue.
4. Check Your .htaccess File for corruption.
A corrupt .htaccess file can lead to a 500 Internal Server Error in your WordPress site. To check if this is the issue, try renaming the file to “.htaccess_old” or something related to it.
You can locate the .htaccess file under your site’s root directory. When you get to it, right-click the .htaccess file and select rename from the menu.
After doing this, check if the error message has cleared. If it clears, you can go ahead create a new .htaccess file. Locate your WordPress admin screen, go to Settings, and then Permalinks. You can then click on the Save Changes button at the lower part of the screen.
5. Increase The PHP Memory Limit
If your .htaccess file is not corrupt, then the next most likely cause could be a low PHP Memory limit. You could exhaust your PHP memory in several ways; one common way is through a poorly coded theme or plugin. If this is the case, you would need to increase the PHP memory. Hosting providers don’t permit their users to increase PHP memory themselves, so you would have to contact yours to do it manually for you.
There are several ways you can increase your PHP memory limit. There are three possible files where you could add PHP memory code snippets.
The first is the wp-config.php file. To find it, search for WP_MEMORY_LIMIT if it exists. If you find it, change the value to 256M but if you don’t find it, add the following code line to it:
Another method is through the php.ini file; this also may not exist. So, if it doesn’t, you could create a blank text file, name it ‘php.ini’ then paste this code:
Yet another way is to check the .htaccess file. If no memory exists, you can add this command to the file:
Save the file and reload the site. If the error clears, you have to contact your hosting provider to find out more about the memory limit being exhausted.
6. Check for PHP version issue
If the plugins are not compatible with the PHP version, it could lead to a 500 internal server error. Your site should be running PHP 7 or higher. Use the method stated earlier to detect the faulty plugin.
If you can access a cPanel, navigate through and choose a PHP Version you will find in the Software section.
Then contact your hosting provider to give you information on changing or upgrading your PHP version. Your hosting provider can either upgrade or change your PHP version. If it is not possible to do this, you can choose to delete the Plugin or find a good alternative.
7. Reinstall Your WordPress Core Files
After all the above methods, if the 500 Internal Server Error Message still appears on your screen; then there is one last thing you can do. Your WordPress core files might be corrupt. Therefore, it would be a good idea to reinstall and re-upload them.
To do this, download the WordPress zip file from the WordPress.org site and extract it; you will find a WordPress folder. Use an FTP client to your website. The next step is to visit the root folder of your website. Select the ‘wp-includes’ and ‘wp-admin’ folders, right-click and select ‘upload.’
After the folders are transferred to your server, you would receive a prompt asking if you want to overwrite the file. Select ‘overwrite.’ Your FTP client would now replace older core files with new ones to fix the issue of a corrupted file. Note that this process does not delete your information from the site but solves a corrupted file problem.
After doing this and reloading your site, you are not to see the error message. But, if you do, there is one last resort.
8. Reach out to your hosting provider
After trying all these methods and you get the error message, it is best to reach out to your hosting provider for assistance. They could check the server thoroughly to determine what could be the cause of the error.
Your hosting provider could check the server logs for any errors and check for file permissions also.
Also, a repeated encounter of this error could mean that the website server is not fully equipped to host your website. Therefore, your hosting provider can look into the problem and proffer solutions that would help resolve the error.