500 Internal server error is the most common WordPress error. Since the error does not point to a particular issue and there are various possibilities causing such an error. In this article, we will show you how to easily fix internal server error in WordPress.
What Causes Internal Server Error in WordPress?
There’s no real indication as to what really went wrong and caused the error. Internal server error in WordPress is often caused by plugin or theme functions. Other possible causes of internal server error in WordPress that we know of are: corrupted .htaccess file and PHP memory limit.
Don’t worry, though, there are some good solutions…
Define ( “WP-DEBUG”, TRUE );
WP_DEBUG
is a PHP constant (a permanent global variable) that can be used to trigger the “debug” mode throughout WordPress.
Enabling WP_DEBUG
will cause all PHP errors, notices and warnings to be displayed. This is likely to modify the default behavior of PHP which only displays fatal errors and/or shows a white screen of death when errors are reached.
You can turn debugging on by editing your site’s wp-config.php
file. Once you’ve accessed this file, search for WP_DEBUG
within. If you find it, you should be able to set it to “true”. If you don’t see it in there, you’ll need to create it yourself.
define( "WP_DEBUG", true );
Once saved, reload your site to see if anything has changed. If you’re lucky, the server error may disappear and might be replaced with a different error, one that actually tells you where the issue is.
Check Your .htaccess File
The .htaccess (short for ‘hypertext access’) file is a distributed server configuration file. This means that it configures the server only in the directory the .htaccess file is in.
First, make a backup of the .htaccess file then delete everything inside the file and paste the code as shown below and save it.
# BEGIN WordPress RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
If the error is now resolved, the issue was with the .htaccess file.
Increase Your Memory
If you are seeing the internal server error only when you try to login to your WordPress admin or uploading an image in your wp-admin, then you should increase the memory limit.:
To get this done, open your wp-config.php
file in the WordPress root directory and search for WP_MEMORY_LIMIT
. If it exists, change the value to something like “64M”. If it doesn’t, paste the following line into the file:
define('WP_MEMORY_LIMIT', '64M');
If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.
Deactivate All Plugins
If the above solutions don’t work for you, then this error is most likely being caused by a specific plugin. It is also possible that it is a combination of plugins that are not playing nice with each other. To deactivate the plugins :
- Locate your WordPress installation directory
- Double Click on the wp-contents folder
- Rename Plugins folders to Plugins1(or whatever you like) This will deactivate all plugins.
Now try reloading you site. If your site loads normally then the error is caused by Plugins. Now undo-rename the plugins folder and try deactivating the plugin one by one to find out which one is causing the issue.
Get Support From Your Host
There are a few uncommon issues that can lead to internal server errors in WordPress, but at this point, it may be best to ask your host. The issue could be a genuine server issue, which they can at least confirm and they can also look at things like file permissions and other sources.
Reinstall WordPress
There are some edge cases where a reinstall of WordPress could fix the issue. It may even fix file permission problems along the way. To get this done, I recommend following the manual WordPress Update instructions in the WordPress Codex.
Bijay Pokharel
Related posts
Recent Posts
Subscribe
Cybersecurity Newsletter
You have Successfully Subscribed!
Sign up for cybersecurity newsletter and get latest news updates delivered straight to your inbox. You are also consenting to our Privacy Policy and Terms of Use.