500 Internal Server Error is the most common error that happens to WordPress. It often happens when there is an issue with the server that is running your website. It may happen in your server or the directory of your website.
The process of fixing this error is long and tiring. In this article, we tend to introduce ways of fixing 500 Internal server error in WordPress.
What is 500 Internal Server Error?
500 Internal server error comes from HTTP. This error generally pops up when you install a plugin on a running server or when there is an issue with your host.
This error can also occur when you make changes to the .htaccess file or PHP. However, dysfunctional plugin and themes can also cause this issue.
Fix the 500 Internal Server Error in WordPress
Troubleshooting this error can be difficult and time-consuming. However, there are efficient ways that we will introduce in this article. But before anything, it’s highly recommended that you fully backup the website, in case anything goes wrong you can restore your website.
1. Contact the Hosting Provider
As we mentioned above, one of the reasons that 500 Internal server error occurs can be within your hosting provider. So, the safe first step is to contact your hosting provider and ask them to help you with the issue.
Most of the time if your server is causing the error your hosting provider will fix. Although, that’s not the case all the time, and you will have to manually fix the error.
If your hosting provider tells you that the error is not coming from their server. Then you can upload this file to your directory. Once the file is in your directory (root) simply open this URL YOUR_DOMAIN.com/info.php if there is no issue with your server, you should be able to see your server details on the screen.
But if you see 500 Internal server error then you are absolutely sure that error is coming from your server. Thus, you can provide the said URL to your hosting’s support team.
2. Fix the .htaccess File
.htaccess is very important. If you make any changes to it, it may break the website and cause 500 Internal server error.
One of the fastest ways to find the issues is through .htaccess file, simply with FTP or file manager head over to your directory. Then rename .htaccess to htaccess_old, after renaming the file, try to open one of your web pages. If you succeed then that means your .htaccess file is broken.
To fix this issue simply head over to the WordPress Dashboard, go to Settings and Permalinks and click save without making any changes. This will create a new .htaccess file and should fix your 500 Internal server error.
3. Increase the PHP Memory
Your PHP memory is set to a number by your hosting provider or WordPress. Although, WordPress allows you to increase your PHP memory to the amount your host has provided. Sometimes 500 Internal server error is caused by PHP memory.
If you see “internal server” error when you try to login to your admin page (dashboard) or try to upload an image through your dashboard, then follow these steps to increase your PHP memory limit:
- Create an empty notepad file and call it php.ini
- Write memory=64MB in the notepad
- Save the file
- With FTP or file manager upload this to your wp-admin folder
If the problem is solved by increasing the amount of PHP memory, then you should know that this fix is temporary and you still have to find out the main reason for your memory limitation.
Which can be a plugin or a theme. We strongly recommend you to ask your hosting provider to check your server logs so you can accurately diagnose the problem.
Another way of increasing your PHP memory limit is by adding define(‘WP_MEMORY_LIMIT’, ‘64M’); to your wp-config.php file. To do so, simply download the said file from your directory, edit it with your preferred editor, save it then upload it back.
4. Re-upload WordPress Core Files
Sometimes a file may get deleted or changed in the installation folder of WordPress. If you want to make sure that’s not causing 500 Internal server error, you must re-upload wp-includes and wp-admin on your directory. To do so head over to WordPress.org and click on “Get WordPress”.
Once your download is finished, unzip the file and locate wp-includes and wp-admin then simply re-upload them to your directory with FTP.
You may get a message saying these files already exist, simply select overwrite and click OK.
Now FTP client has replaced old files with your new files. If your WordPress files are causing this error, by following this method it should fix 500 Internal server error in WordPress.
5. Deactivate Plugins
If by following the ways mentioned above you are still seeing the error, then it’s safe to say that one or some of your plugins is causing the 500 Internal server error. Unfourtanely, there is no proper way of dealing with this issue and you have to deactivate all of your plugins at once.
To do so, head over to the WordPress Dashboard, and click on “Plugins”. Now you have to deactivate and activate your plugins one by one to figure out which plugin is causing this error. Once you found it, simply report the bug to its developers so they can fix it in the coming updates.