One of the most common errors in WordPress is the 500 internal server errors. Not knowing how to fix this error is one of the aspects that might trouble you. Another aspect is the fact that this error comes without any detailed information about what caused the error to generate. We will first see the reasons that might cause the internal server error in WordPress, and then we will see the easy way out to solve this error.
Causes of Error:
Not only in WordPress, but in any other websites as well, the internal server error is not at all informative. It is generically a problem that doesn’t give any idea about the problem itself. Solving a problem without knowing the problem may not sound good. So, we will see some of the most common reasons that might cause this error in WordPress.
The common reasons behind the 500 internal servers are errors because of plugins or errors due to the theme functions. Other reasons can be, errors due to corrupted .htaccess files or errors due to PHP memory limit. It is also possible that, in WordPress, the parts of the website other than the admin area are not causing any problem, but the internal server errors occur while accessing the admin area.
Solving the Internal server error in WordPress:
Corrupt .htaccess File:
Check for the corrupted .htaccess file. This could be your first step in solving the error. The process of troubleshooting the internal server error in WordPress through this way includes the steps that we are going to discuss next.
- Log in to your site using the FTP or File Manager app in the cPanel dashboard of your hosting account.
- After connecting, go to the directory of the folders wp-content, wp-admin, and wp-includes to find the .htaccess file.
- Rename your main .htaccess file. For instance, .htaccess_old.
- Go back to the site again.
- Check if the internal server error is resolved.
- Now, go to the WordPress admin area.
- Visit the Settings » Permalinks page.
- Click the save button without any modification.
Thus, a new .htaccess file will be generated. This will make sure that the error doesn’t return.
PHP Memory Limit:
If checking for the corrupted .htaccess file does not solve your problem, you can check if the PHP memory limit is completely drained. If the reason behind the internal server error is PHP memory limit, you need to increase the PHP memory limit in WordPress to solve the issue. You may find out that the error is caused only while you login into the WordPress admin or while uploading any image in the wp-admin. If the above is the case, you can go through the below mentioned step-to-step process to increase the PHP memory limit in WordPress.
- Create a blank text file.
- Name it php.ini.
- Paste the code: memory=64MB in the file.
- Save the file.
- Use FTP to upload the file into your /wp-admin/ folder.
Even if the problem is solved, it might be a temporary solution. Finding the cause behind the depletion of the PHP memory limit is of utmost importance here. The reason behind the exhaustion of the PHP memory limit might be a poorly coded plugin or even a theme function. The exact analysis might be made after checking the server logs. For this, you can take help from your WordPress web hosting company.
Plugins:
The process of troubleshooting the internal server error in WordPress may continue if the problem is not solved. A specific plugin is another important cause or it might be a combination of plugins. The easiest way to solve such an issue is to deactivate all the WordPress plugins at once. For this, the step-by-step process is mentioned below.
- Go to the WordPress admin area.
- Click on ‘Plugins’.
- Reactivate one plugin at a time.
- Continue the process until the plugin causing the error is found.
- Get rid of the error-causing plugin.
- Report the error to the plugin author.
If this process solves the issue, it is clear that the plugins are the sole reason behind the error.
Core Files:
If nothing from the above solves the error, re-uploading the core files might be one of the options left for solving the error. Re-upload the wp-admin and wp-includes folder from a fresh WordPress install to check if the reason behind the internal server error is the corruption of the file and then to solve the problem. Following this process will not remove any previous information, so be ensured and follow the below steps to re-upload the core files.
- Visit the WordPress.org website.
- Click on the Download button.
- A WordPress .zip file will be installed on your device.
- Extract the zip file.
- A WordPress folder will be found inside.
- Use an FTP client to connect to your WordPress website.
- Now, go to the root folder that contains the wp-admin, wp-includes, wp-content folders.
- Open the WordPress folder on your computer.
- Select the wp-includes and wp-admin folders.
- Right-click with the mouse and select the Upload option.
- This will transfer the selected folders to your server.
- Select Overwrite option to overwrite the files.
- Then, select the “Always use this action” option.
The previous WordPress files will thus be replaced with fresh ones.
Web hosting support team:
If all the above methods fail, contact your hosting provider. The only option now left to find the root cause of the error is to check the server logs.