It is the most common error in WordPress. It does not give any information about the error. For developers, it will be easy to fix it but for non-technical or beginners it will be a bit of a challenge. In this article, we will show how to debug and solve internal server error.
Internal Server Error not only appear in WordPress but I can happen in any website. Due to generic nature of this nature, it will not give any information, so we need to use different methods so sort out the issue.
Below are a few methods for troubleshoot the error.
First step is to check your .htaccess file. It is located in the installation folder of WordPress. Same place where wp-admin & wp-content folder is placed. Try to rename the file to .htaccess-old and refresh the page, if it solve the issue then go to dashboard->settings->permalinks and update the permalink. It will generate the new .htaccess file. Another method you can use by changing the .htaccess code. Put the code in .htaccess file which is given below.
# 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
Make sure you renamed the file back to .htaccess. if this method does not solve the issue then we need to try another method.
Sometimes the internal server error appears when you are trying to upload a large file that may exhaust the memory limit. WordPress default memory limit is 32MB. There are three options you can use to increase the memory limit.
Edit your wp-config file: This file is located in root folder of WordPress. Look for the line to edit the memory.
define('WP_MEMORY_LIMIT', '40M');
Increase the limit as you want, 128M should be enough.
Edit your php.ini file: If wp-config file does not solve the issue, then you need to go through the server settings. On shared hosting you cannot access the php.ini file. This is what you need to do:
If you create your own php.ini file, you need to add the following line:
memory_limit = 256M
Edit your .htaccess file: If you cannot access the php.ini file then you need to edit your .htaccess
file. It is located in the root directory of WordPress installation. Below are the code you need to add in your .htaccess file.
php_value memory_limit 256M
You can turn on error log in WordPress in just a few steps.
In wp-config
file, You might see the following line of code:
define(‘WP_DEBUG’, false);
delete it and copy the following line of code:
Make WordPress debug enable:
define(‘WP_DEBUG’, true);
All the errors will be saved in debug.log. You can find this file in wp-content
folder.
define(‘WP_DEBUG_LOG’, false);
To display error messages on screen add this line of code:
define(‘WP_DEBUG_DISPLAY’, false);
Save your changes and debug mode will be turned on.
If increasing the memory limit will not solve the error, then you need to deactivate all the plugins. If internal server error is resolved by doing it then activate the plugin one by one until you find which plugin is causing the issue and remove that plugin.
If error still exist then re-upload the core files of WordPress, which includes wp-admin and wp-includes, you will not lose anything by uploading the files. This could be an issue if a virus has altered the WP core files. In which case, you may have bigger fish to fry.
If all given methods fail then you need to ask your hosting provider to look at server logs and find the root cause of the error.
We hope this article will help you to debug the internal server error on your website. If you have WordPress 500 error then you can discuss it with a WordPress Expert.
Our support staff is available 24/7 to take support calls and messages from clients.
We involve client in all stages of software development to deliver satisfaction and peace of mind.
We hire developers that are technically strong and discuss the project thoroughly before starting.
If you are not happy with the quality of work or we fail to achieve final technical goal, we’ll not take your money.
We have worked with some clients for over 7 years. Our commitment and dedication is a matter of pride for us.
We care about your investment. We will tell it straight if you are making a bad decision.
NDA implied. No spam. Privacy guaranteed.
Best web, app, eCommerce and custom software development company. We provide services to more than 100 clients world-wide.
Contact The Right Software today to discuss the your next big idea.