500 internal server error is one of the most frustrating error that you can get encountered with in WordPress. Since there are many reasons that can cause internal server error, it does not have a straight forward solution. You have to troubleshoot each possible causes of the problem which can be time consuming and energy sucking. Furthermore, this internal server error does not tell the developer anything about what might have caused the problem. Internal server Error has enough ability to bring most new WordPress developer to a state of panic and frustration. This article shows hot to fix 500 Internal Server Error in WordPress.
How to Fix 500 Internal Server Error in WordPress
If you too are being troubled by this common but deadly error then this article might be helpful to you. In this article we will discuss all the probable causes and their solutions related to this error. Sometimes problems look hard enough but the solution might be very easy. May be a minute malfunctioning is causing this error. So let’s troubleshoot each possible cause and fix them one by one.
1. Corrupted .htaccess file
500 internal server error can frequently occur due to incorrectly configured rewrite rules contained in your .htaccess file. Temporarily try removing .htaccess file from folders. You can rename the .htaccess file name to something else like .htaccess_check. Now refresh the website. If the error continues then try other methods mentioned in the articles.
Else if you find your problem is fixed then you have successfully identified the cause of problem in the first shot. Now, you can delete the corrupted .htaccess file but before deleting make sure you keep a backup of the file. Finally, follow these steps to create new .htaccess file.
- From the admin dashboard go to Settings > Permalink
- This opens the permalink setting page. At the end of the page you can find the save button. Just click the save button and your new .htaccess file will be created automatically.
2. The PHP Memory Limit
One other common cause for this error is reaching or exceeding the PHP memory limit. PHP memory is needed for plugin and scripts to load and work on your website. You can increase the PHP memory limit assigned in your settings and check if this solves the problem.
There are two ways you can increase your PHP Memory limit
i. For 500 internal server errors that are occurring on the WordPress admin:
If you are seeing the internal server error when trying to login to your wp-admin or uploading an image, then you can use this method. In your wp-admin folder create a new blank text file and name it php.ini. Just add these lines in the file.
memory = 64MB
Now save the file and check if the problem is fixed. If you already have the php.ini file in your wp-admin folder, then find the above mentioned line where memory limit is assigned and increase the number.
ii. For 500 errors that are not limited to the WordPress admin:
In the root directory where WordPress is installed, find the file named wp-config.php. This is a sensitive file so be careful and also keep back up before making any changes. Add the following lines to inside the PHP tag inside the file.
Just save the file and check if the internal server error is gone.
3. Plugins and theme
Plugins and themes that you have installed in your WordPress can also cause this internal server error. In this case you have to identify the specific theme or plugin that is creating problems and remove it. Since you don’t have access to your admin dashboard while facing this error, you will have to manually test the plugins and themes by going to the site’s folder. You can use FTP or cPanel to get access to your site’s files. You can find the themes and plugins stored inside wp-content folder.
In the plugins folder you can find individual folder for each plugin installed. Just rename all plugins folders by appending something to it. For example if you have a plugin folder called akismet rename it to something like akismet–testing. Since the plugin folder have been renamed, this will be deactivate the plugin. Now check if the error is gone.
If you find the error is gone, then one of your plugin is creating the server error. Now you have to rename each plugin back to original one by one. After each reverts, check if the error still exists. Thus you can identify that particular plugin causing problem. Once you identify the faulty plugin you can get rid of it and problem is solved. You can follow this similar procedure for themes as well.
4. Corrupted Core File
If your problem still exists, then you need to re-upload the core files. Login to your site with FTP and re-upload two folders wp-admin and wp-includes from fresh WordPress install. Make sure you do not upload wp-content folder since it contains all the plugin, themes, and other customization of your site. Changing wp-admin and wp-includes folder will not affect your site. If your core file is corrupted then this should solve your problem.
5. Bad Permissions, Writeable by Group
To troubleshoot this error, check your file permissions.
- In cPanel, in the Files section, click File Manager.
- Select the button for Web Root (public_html/www).
- Place a check mark in the box titled Show Hidden Files (dotfiles).
- Click Go.
- Review the numbers listed under the Perms column in File Manager.
- Directories and folders should be set to 755.
- Executable scripts within the cgi-bin folder must be set to 755.
- Images, media, and text files like HTML should be set to 644.
6. Contact your host
If none of the above mentioned solution worked, contact your hosting provider. Your hosting provider can check the server log and help you find the exact cause of this internal server error. Sometimes the error can be coming from the host’s end too. So it is better to contact your host if the problem persists.
The internal server error can be a difficult one to solve because it is a general error that comes up for a whole set of potential problems. The above mentioned solutions will work for most of the cases but still there are many other causes too that can create this annoying error. So if these troubleshooting methods didn’t work, do not worry. Get hold of your host and try working with them. We hope the article was helpful in fixing the 500 internal server error in WordPress.
Latest posts by Kantiman Bajracharya (see all)
- What are Different WordPress Theme Licensing Terms? - December 21, 2017
- 4 Tips to Optimize Your WordPress for Social Media Share - November 30, 2017
- What is WordPress? Is WordPress Free? Why is WordPress so popular? - November 22, 2017