How to Fix Internal Server Error in WordPress

0
799
Internal server error

Last updated - May 10, 2018

500 Internal Server Error is not less than any puzzle. It can leave you confused. You may wonder you have the best hosting service provider than how come you have a 500 Internal Server Error? In this article, we’ll see what causes an Internal Server Error and how to fix 500 internal server error?

500 Internal Server Error

As the name suggests, these errors are mainly caused due to issues in your servers or the root directory of your website. You can see your pages getting affected by the error. Usually, you don’t get a great deal of information from the error messages, which makes these errors time-consuming. These errors can test your patience at times. But, we are going to discuss few ways to troubleshoot the error.

Possible Causes of 500 Internal Server Error

  • External Functions added due to additional Plugins and Themes
  • Corrupted .htacces file
  • PHP memory limit
Before you start

Before you start fixing the 500 Internal Server Error, there are few things you need to keep in mind. Since the process is going to affect your file system, you should get a backup of all these website resources. As you can’t rely on one method to fix this error, the backup will help you restore your website. Once your backup is ready, let’s move to the common solutions for fixing 500 Internal Server Error.

Fixing 500 Internal Server Error

Resolving .htaccess file issue

One of the most common causes of the 500 Internal Server Error is a corrupted .htaccess file. Any third party plugin, theme installation or any programming conflict created thereafter may corrupt the .htaccess file.

.htaccess file

WordPress needs a file to manipulate the way Apache fetches files form root directory and sub-directory. .htaccess file is the distributed configuration file present in your website that specifies the way Apache will take care of any change in the configuration in any directory of the root directory.

When the configuration changes, due to the external plugin or theme, are not executed properly, your website may show the 500 Internal Server Error when you access the admin area.

To fix this issue, you must create a new .htaccess file. To create a new .htaccess file:

  • Go to your root directory
  • Find the .htaccess file(screenshot above)
  • Rename the file by login into FTP or file manager app from your hosting accounts cPanel dashboard.

Once you rename the file, go to your website dashboard and then Settings > Permalinks to click on save changes button. Saving changes will automatically create a new .htaccess file in the root directory.

500 Internal server Error
Saving Changes in Permalinks

You can check the new file in the file manager at the same place as before. If you don’t see the new file, try refreshing the folder. When you see the new functional .htaccess file,  delete the older file, which you renamed earlier. After deleting the older .htaccess file go to your website and see if the issue is resolved.

Even after adding a new .htaccess file, you encounter a 500 Internal server error, you need to move ahead and consider increasing the PHP memory limit.

Resolving PHP Memory Issue 

Addition of additional extensions sometimes requires increasing the memory limit of PHP. In case the memory limit is less, it becomes the cause of 500 Internal Server Error. 

As you know PHP memory limit depends on your server service provider. Your website automatically reaches the maximum limit in case of requirement. But once it requires more memory, it might show a 500 Internal Server Error. As a solution consider increasing the PHP memory limit. Here is how you can increase the PHP memory limit:

First, download your wp-config.php file from the root directory hosted by the FTP client or file manager from the hosting control panel. To download it right click on the file, to find the download option. After downloading it, open the file in an editor and set define(‘WP_MEMORY_LIMIT’, ‘256M’); to the allowed value. Next, upload the file back to your wp-config.php file followed by a folder refresh. After the refresh of the folder and the website, the Internal Server Error must cease.

You should note that this is just a temporary solution, and must contact your server service provider to find the real cause of the exhausting space and a right solution for the problem.

Once you finish expanding the PHP limit check its response on your website. And, if you are still experiencing the Inter Server Error, don’t forget to remove the code from the wp-config.php and uploading it back without any code.

Lesser used Solutions

Azhar writes about Troubleshooting WordPress with common problems and their solutions. You’ll find a flowchart to troubleshoot any common WordPress problems. You’ll also find some of the common but lesser used troubleshooting efforts when it comes to 500 Internal Server Error. Here are some of the common causes and their solutions.

Checking Faulty Plugin/Themes

It may be possible that any of your installed plugins or the theme is causing the problem. First, start deactivating your installed plugins one by one. With each deactivation, you need to refresh the website to see if the problem is still there. You can deactivate the plugins from the WordPress dashboard or by using the root directory which houses the plugins too. Renaming the plugin the root directory deactivates the plugin. Once you are finished testing, you should change the plugin’s name to the original one.

While doing so, you find the problem is gone, it means the error was due to the recently deactivated plugin. Although the error is gone, if you still need the plugin, you contact the respective plugin developer to fix compatibility issue.

Updating Root Directory

If plugins are not causing the error, the last thing you should try is uploading the updated directory files. Download the latest WordPress and upload wp-admin and wp-includes to your website to the servers using the FTP.

Internal server error

How to update WordPress?

As discussed above, you are required to download and extract the latest version of WordPress. Then you need to contact the FTP client of yours, to get a secure connection with the server and upload the latest files to your website directory. While uploading select the option of “override” the existing target files. This will replace the older versions of the files. And if the 500 Internal Server Error was due to the corrupted versions of the folders, you can expect the error to disappear.

Internal server error

Checking with Hosting Service Providers

If you have tried updating .htaccess file, raising the PHP memory limits, updating or deactivating the faulty plugins, updated the root directory and still there is no chance of resolving the 500 Internal Server Error, it’s time to speak to your hosting partner. You should keep in mind that the checks we have seen above ensure that the error is not due to the concerns in the root directory. So it’s better to be sure before contacting the hosting support.

Hosting service provider support than, may require to check your website’s server log and come up with the conclusion of the reason for any such error.

Closing Words

Since the 500 Internal Server Error gives no straight edge reason of the error, nor there is a specific fix for the problem. You can analyse the discussed solutions that 500 Internal Server Error has a lot of causes. It can be a faulty plugin or an unresponsive theme, a less memory space of your website’s PHP, or an older corrupted version of WordPress.

So to keep your website away from 500 Internal Server Error, you might want to upgrade to the latest available versions of the plugins/themes and root directory files. if your very important plugin is not compatible, contact your developer for an early compatibility with your existing setup. Keep the plugin deactivated until it is fixed or use a function instead given by experienced programmers.

You should also ensure that your Hosting server package is providing more services than your website needs. This will reduce any chances of errors related to the root directory of your website. I hope I am leaving you with enough ways to fix Internal Server Issues and help you in saving a lot of time.

If you have any queries or want us to provide any other troubleshooting guide, leave a comment. 

LEAVE A REPLY