After installing WordPress, a WordPress plugin, or a theme if your site returns suddenly a 500 Internal Server Error, don’t worry much. This article will give you more information on it!
There are five major reasons for these errors to occur in WordPress:
1. Incorrect web server configuration
If your web server (whether it be Apache or IIS) is configured with incorrect directives, they can cause 500 errors to occur. If you have checked the following remaining causes, and they fail to resolve the issue, then the problem surely is of the server configuration. So the web hosting support should take care of the problem.
They may blame the error on software you have installed without even checking to see what is contained in their error logs, but after having checked the following steps, they will need to help diagnose and fix the problem.
2. Incorrect file permissions
This isn’t often the cause, but may happen that file permission for WordPress, plugins, and themes, who need to be set at 755 for folders, and 644 for files, may be set differently. It is not a good idea to think that setting permissions more loosely, like 777, or on contrary setting permissions too strict, will relieve the problem. It can actually often cause this and other errors.
3. Corrupt files or files containg errors in code
Usually improper/errors in file transfers to the web server cause corruption to occur. It may look like the file is sitting there just fine, but something in the process caused the file to be unusable by the server. For example, if you uploaded a text file in binary language instead of ascii it will render the file unreadable by the web server. Coding errors can also create this error, whether that be in WordPress, a plugin, or a theme.
- Often, the only way to resolve an error in WordPress core is to reinstall WordPress.
- If it is plugin related, deactivating all plugins will relieve the error.
- If it is theme related, deleting and reinstalling the theme will often take care of the problem.
By far the most common 500 error produced by a file is related to the WordPress .htaccess file. The .htaccess file is primarily designed to be used with custom permalink structures. But it is also used by some third party plugins, and for overriding certain server configuration directives if allowed. If it contains errors, it can return the dreaded 500 internal server error. The .htaccess file is located in the root folder of your WordPress installation (not the theme).
- log into your site via FTP (Filezilla, etc.)
- download a copy of your .htaccess file, rename the copy e.g. “.htaccess-backup”
- delete the .htaccess file residing on your Web server
- create a new blank file called “.htaccess” on your PC/laptop/Mac
- upload this new file to your Web server in the same place as the original .htaccess (which you deleted)
- navigate to your WordPress admin URL, e.g. http://www.yoursite.com/wordpress/wp-admin, and you should now be able to log in!
finally, once logged in, navigate to the Permalinks settings page in the admin console and do nothing further. Simply going to the settings page should enable WordPress to write the correct .htaccess declarations itself. You should now be able to nagivate to www.yoursite.com or http://www.yoursite.com/wordpress (depending on whether WordPress is running your entire site or just a blog etc.) and all should be well once more.
4. PHP memory limits set too low.
There are two ways to solve this.
- Ask your web host to increase your PHP limits.
- Upload theme via an FTP client. Please read here a tutorial that explains how to use FTP to install your theme.
5. Conflicting Third Party Plugins Should Be Deactivated
- Login to your dashboard and go to plugins section. Deactivate all plugins. Now check your front end page again. If it loads without error, you have a plugin conflict. Start activating each plugin one by one. When you see the 500 error again on the front end pages, you will know that the last plugin you activated is the culprit. Deactivate it and continue checking all remaining plugins one by one to make sure there are no others.
- If you are getting the 500 error on the front end and the back end admin area, then you will need to access your site via an FTP client. A little known trick is to change the name of your /wp-content/plugins folder to something else temporarily like “plugins.bak.” This will make WordPress ignore your plugins. Then check to see if this resolves the problem. If it does, log into your admin section and then change your plugin.bak folder back to plugins . Then deactivate all of your plugins via your admin page.
Recommended PHP configuration limits are as follows:
- max_execution_time 180
- memory_limit 128M
- post_max_size 32M
- upload_max_filesize 32M
How To Verify Your Current PHP Limits
You can verify your PHP configuration limits by installing this plugin here. Or you can always contact your host and ask them what the current settings are and have them change if needed. Many hosts may try to keep the PHP limits low without reason.