Fixing 500 error in WordPress - SkillBakery Studios

Breaking

Post Top Ad

Post Top Ad

Monday, February 15, 2021

Fixing 500 error in WordPress

Internal server errors in WordPress are the worst (aka. http error 500), (ie: usually your server is working fine). In this article, we'll discuss about  this internal server error in WordPress and show you how to get rid of it: 

What is the 500 internal server error

Basically, error 500 states that there’s no real indication as to what really went wrong and caused the error. The only thing that’s certain is that the error is caused by some operation that went wrong on the website’s end. Particularly in WordPress’ case, this can mean that a script that’s part of a theme or a plugin did something it shouldn’t have done, and now your server has crashed.

Resolving 500 internal server error

500 internal server error solved in following  steps:

1. Turn on debugging

Whenever WordPress throws you a white screen of death or a server error, turn on debugging , it may give you more insight into what’s going on.
To turn on debugging edit 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”. 
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.
If this is the case, take a look at where the error is located. If it is within a plugin folder, disable that plugin, the error should go away.
Even if turning on debugging doesn’t give you a great result, it is a good idea to leave it turned on until the issue is resolved. It will give you and any developers more insight into what’s going on. Don’t forget to turn debugging off once everything is ok and you’re done with the maintenance!

2. Deactivate all plugins and switch themes

If dashboard is accessible , you should deactivate all your plugins and see what’s what. If your website loads without the server error the issue was with one of your plugins. You can also switch your theme to a default, unaltered WordPress theme to analyze the error. If the site loads without the internal server error, the issue was within your theme.

3. Check your .htaccess file

The .htaccess file, if it exists, contains a number of rules that tell the server what to do in certain circumstances. It is commonly used for rewriting URLs or preventing access to your site for malicious intent. If there is an .htaccess file there, make a backup and then delete all the contents within, or the whole file. This may remove some important rules, but if the internal server error was caused by a mistake within the file, this will tell you.

4. Increase your memory

 I’ve heard that increasing your memory limit might be of help sometimes  help. 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 this works then you’ve only solved the issue temporarily. Chances are that you have a faulty bit of code somewhere (which could be a third party plugin) that is exhausting your resources.

5. Reinstall WordPress

I shouldn’t think this would help in most cases, but there are some edge cases where a reinstall of WordPress could fix the issue. It may even fix file permission problems along the way.

Summary

Internal server errors in WordPress are usually caused by some wrong code which breaks the site functionality, and not the actual server error. Most of the time, they can be corrected relatively easily using the methods described above. If in doubt, always ask your host, they have far more sophisticated tools than you do to locate and fix issues.




No comments:

Post a Comment

Post Top Ad