No doubt that everyone loves WordPress. What’s so unique about this Content Management System that its version 4.1 was downloaded by approximately 22,681,153 times? There is a lot to add to the list of benefits of WordPress – right from it being free to flexibility and support. One of the key reasons is that it’s FREE and small businesses with low budget can easily afford it. Even large businesses prefer to use WordPress as it is search engine friendly and offers plenty of options. Of course, it can’t be overlooked, it’s mobile friendly which is the need of today’s trending mobile world.
For some, WordPress simply drives them crazy, isn’t it? That’s true. If some software is offering such great features then who wouldn’t like to use it? In addition, businesses have started using WordPress for lead generation. Lead generation has become the need of the hour for all types of businesses since it helps to get access to large number of contacts. Having a CMS simple to understand and use as WordPress, is almost next to impossible, atleast on this day.
But sometimes an internal server error may lead you to fall out of love with WordPress. It really annoys you when there’s a white screen prompting the message of an internal server error. For users who rely on their WP based website as a source of earning, the error may seem similar to an atomic explosion! Well, as a matter of fact, you don’t have to worry too much about it. Errors like the white screen of death, internal server error, error establishing database connection and others can be fixed easily. It’s just that you need to be aware about the solution for fixing such errors.
Why do you get internal server error in WordPress?
Internal server error isn’t specific to WordPress and it can happen with any other software running on your server as well. Since the message appears in a generic format, it doesn’t explain anything more to the developer. Asking how to fix the internal server error is similar to asking a doctor how to fix the pain without telling him where it is. The two significant causes of internal server error are – plugin and/or theme functions OR corrupted .htaccess file and PHP memory limit.
Here is a solution to the internal server error based on different scenarios –
Corrupted .htaccess Files Checking –
The first and foremost step is to check the corrupted .htaccess files to fix the internal server error. To check these files, you can rename the main .htaccess file to a new one and then use FTP to login to your websites. After these steps, the .htaccess will be placed in the same directory where you can see some folders comprising of wp-includes, wp-content and wp-admin. When you find the .htaccess file, load the website/s to check whether the issue is resolved. If your website is back to normal, it means you have fixed the internal server error. Remember to go to Settings – Permalinks to click the save button. If the internal server error still exists then you need to check on the next cause.
Exhausting Your PHP Memory Limit –
It’s not you surely, but there might be a culprit that is exhausting your PHP memory limit. It could be a script, a poorly coded plugin or even a theme. The quick thing to fix the error is to increase your PHP memory limit. You can contact your hosting provider for the same or even do it yourself, if you have the confidence doing it. Open your wp-config.php file via FTP or via your File Manager (through cPanel) and add the following line in the php tag:
and save the file.
If lack of php memory is the cause then doing this will surely fix the problem. If the issue still persists then you should contact your hosting provider to find out what is consuming the php memory. If the 500 internal server error appears only when you try to upload a media file or when you access the admin side of the site, follow the steps below –
- Access the wp-admin folder from the File Manager (cPanel) or via FTP
- Inside the folder, create a new file called php.ini
- Open it and add the line: memory=64MB
- Save the file (Save and upload it to wp-admin folder if you are accessing via FTP).
After that you can contact your hosting provider to find out the reason for php memory limit consumption.
Plugins can be one of the major causes for an internal server error in WordPress. If dashboard is accessible to you then troubleshooting plugins is easy. Just go to plugins and disable the one which you have installed recently. If this doesn’t work, deactivate all the plugins for your website using the select all feature and Deactivate’ them. If you can’t access the dashboard then test the plugins via FTP. If there is an FTP client, simply navigate to the relevant directory. Access the ‘wp-content/plugins’ that contains all the installed plugins, rename the plugin folder with slight name change or add a word at the end – so ‘plugins’ becomes ‘plugins-test’. You can rename the individual plugin folders in the similar manner rather than naming them at once. If you want to reinstall plugins, simply change the folder name to the original one. Faulty plugins may be another key reason for producing an internal server error. You can remove that plugin and replace it with a similar one. Ensure that you find the recent plugin or one that has been updated so that it won’t cause the error.
If plugins aren’t a problem then the theme of your WordPress installation might be. First step is to back-up the theme folder. Then delete your theme and replace it with a default one. If you find that there is some fault in your theme, access functions.php file. Poor coding might be the issue or if you aren’t confident about the code then contact the theme’s author. It is always good to purchase a theme that is trustworthy whose author offers support.
Enable PHP Debugging –
If you are still thumping the desk in frustration, here’s another alternative. Dig a little deeper i.e. enable PHP debugging. Open up the wp-config.php file and then locate the following line –
define (‘WP_DEBUG’, false);
Place ‘//’ at the start and it becomes
//define (‘WP_DEBUG’, false) ;
Then paste the following code directly below the above line –
define (‘WP_DEBUG’, true) ;
define (‘WP_DEBUG_LOG’, true) ;
define (‘WP_DEBUG_DISPLAY’, false) ;
This is where you will require little knowledge of coding. The steps you followed will result in errors that are sent to a file named error.log (in wp-content folder). If there is a trouble to find this file, it means you aren’t permitted to create this file. Simply create a new error.log file and give it permission of 666. Open this file in text editor and check for PHP errors. If you don’t understand this then seek help of your host provider.
Finally, one thing is for sure, you will require the knowledge of coding to fix the internal server error. No matter if the host is there to help you, but it’s better to do it yourself to save time as well as money. And one additional advice, if you are a user facing an issue of internal server error, while entering credit card details or making a purchase avoid making another attempt to complete the transaction or purchase. If you make the next attempt then you might end up doing multiple transactions. It’s better to wait for some time to check on whether the transaction/purchase is moving through before reattempting.
Hope this helps!