Internal server errors are not specific to WordPress, and they can happen with anything else running on your server as well. Due to the generic nature of this error, it doesn’t tell you anything. However, an internal server error is usually caused by a plugin’s and/or theme’s function. Other possible causes of an internal server error are corrupted .htaccess or .wp-config files and an exceeded PHP memory limit. Sometimes an internal server error only shows up when you try to access the Dashboard while the rest of the site works fine.
This article will look at how to troubleshoot an internal server error in your WordPress installation.
Checking for corrupt .htaccess file
When troubleshooting the internal server error in WordPress, the first thing you should do is check for a corrupted .htaccess file. You can do so by renaming your main .htaccess file to something like .htaccess_old. To rename your .htaccess file, you will need to log in to your site via FTP. Your .htaccess file will be located in the root directory alongside your wp-content, wp-admin, and wp-includes folders.
Once you have renamed the .htaccess file, try loading your site to see if this solved the problem. If it did, make sure that you go to Settings > Permalinks and click the save button. This will generate a new .htaccess file for you with proper rewrite rules to ensure that your post pages do not return any 404 errors.
If checking for the corrupt .htaccess file solution did not work for you, continue reading this article.
Increasing the PHP memory limit
Sometimes this error can happen if you are exhausting your PHP memory limit. Use our tutorial on how to increase the PHP memory limit in WordPress to fix that.
If you see the internal server error only when you try to login to your WordPress admin or upload an image in your wp-admin, then you should increase the memory limit by following these steps:
- Create a blank text file called php.ini
- Paste this code in there: memory=64MB
- Save the file
- Upload it into your /wp-admin/ folder using FTP
If increasing the PHP memory limit fixed your site’s error, be aware that this has only temporarily fixed the problem. The reason is that your memory limit is probably being exhausted by a poorly coded plugin or theme. It is advised that you ask your WordPress web hosting company to look into your site’s server logs to help you find the exact reason.
If increasing the PHP memory limit did not fix the issue for you, then keep reading.
Deactivate all plugins
If none of the above solutions worked for you, this error is most likely caused by a specific plugin. It is also possible that it is a combination of plugins that are not playing nice with each other. Sadly, there is no easy way to find this out. You have to deactivate all WordPress plugins at once.
To deactivate all your plugins, follow these steps:
- Connect to your site via FTP
- Navigate to your wp-content folder and rename the plugin folder to something like plugins_deactivated
Once you have done that, all your plugins will be deactivated. Try reloading your site and see if that fixed the problem.
If disabling all plugins fixed the error, you know it is one of the plugins causing the error. Simply go through and reactivate one plugin at a time until you find the one that caused the issue. Get rid of that plugin, and report the error to the plugin author.
Re-uploading core files
If the plugin didn’t fix the internal server error, it is worth re-uploading the wp-admin and wp-includes folder from a fresh WordPress install. This will NOT remove any of your information, but it may solve the problem if any file was corrupted.
If you need help with your HostPapa account, please open a support ticket from your dashboard.