Fixing The 500 Internal Server Error in 8 Different Ways (WordPress website)
As a web admin, running into issues while on your site can be very frustrating. 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 will show you different ways to troubleshoot and fix this error.
One can encounter many issues while using a website; the most common is the 500 internal server error. The error message comes in different formats, depending on your website or browser. In some browsers, it appears as 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. A white blank page popularly known as the White Screen of Death (WSoD) would appear on your screen. In most cases, when this happens, you won’t be able to figure out the problem unless you troubleshoot.
How do you clear the error?
Trying to fix a 500 Internal server error is like treating pain without knowing what part of the body is aching. There are several causes of this error, so you would have to troubleshoot to get a solution. But before troubleshooting, 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 on your screen and 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 vital to back up your WordPress site. The reason is simple. Most of the methods involve modification of your site’s root directory. So, a backup is necessary to avoid losing important data on your site.
Once you have your data safely backed up, you can move on to troubleshooting. The following are different ways you can fix a 500 internal server error.
1. Activate Debugging
As 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 better understand what might have caused the error. You can enable it by editing your wp-config.php through a File Transfer Protocol (FTP) client. Several FTP clients exist, 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 must change the ‘WP_DEBUG’ value to false and try the next solution.
2. Disable the Plugins on Your WordPress
A problem with one of your plugins could be why you are getting an internal server error message. To check if this is the cause, you can temporarily turn off your WordPress plugins. 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 FTP or File Manager.
Through the WordPress admin screen, you can turn off all plugins by going to the Plugins menu, selecting all Plugins by checking the box, and then clicking Deactivate from the Bulk Actions drop-down menu. You need access to your WordPress admin screen to do it this way.
If you cannot access 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, and then change it to ‘plugin-old’ or ‘plugin-deactivated.’
It is essential to know that turning off your plugins will not delete them or get rid of your data. This action stops the plugin code responsible for the internal server error from running.
After turning off your plugins, return 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 determine which plugin is responsible for the error message.
When you find out the plugin is triggering the internal server error, you can either update it, delete it, or contact your web developer for assistance handling 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 updating your existing website theme or recently switching themes, try switching up your site theme and see if the error message clears.
If you can access your admin dashboard, locate Appearance, then Themes. You can then activate the default theme or select a new one.
If you cannot access your admin dashboard, you can change your site’s theme by connecting through FTP. Locate ‘wp-content’; then navigate to the themes folder. Navigate the current theme’s folder and 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 mistake, 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, if the error still hasn’t cleared after changing the theme, you can return to the theme you used and try 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.
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 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, a low PHP Memory limit could be the next most likely cause. 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 must increase the PHP memory. Hosting providers don’t permit their users to increase PHP memory, so you would have to contact yours to do it manually.
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 see it, add the following code line to it:
define(‘WP_MEMORY_LIMIT’,”256M’);
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,’ and then paste this code:
Memory_limit=256MB
Yet another way is to check the .htaccess file. If no memory exists, you can add this command to the file:
Php_valuememory_limit 256M
Save the file and reload the site. If the error clears, you must contact your hosting provider to learn more about the memory limit being exhausted.
6. Check for PHP version issue
If the plugins are incompatible 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, which 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 boost or change your PHP version. If this is impossible, you can 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, 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 for 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 transferring the folders to your server, you will receive a prompt asking if you want to overwrite the file. Select ‘overwrite.’ Your FTP client will now replace older core files with new ones to fix a corrupted file issue. 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 will not 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 getting the error message, it is best to contact 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, a repeated encounter with this error could mean 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.