Wednesday, November 27, 2019
How to Fix the 500 Internal Server Error in WordPress
Internal server errors in WordPress are the worst (aka. http error 500). They provide no real information about the problem and are rarely actual server errors (ie: usually your server is working fine).In this article, Ill try to make sense of this internal server error in WordPress and show you how to get rid of it: The only thing thats certain is that the error is caused by some operation that went wrong on the websites end. Particularly in WordPress case, this can mean that a script thats part of a theme or a plugin did something it shouldnt have done, and now your server has crashed.Dont sweat, though, there are some good solutionsHow to resolve 500 internal server errorMost of the time, you can have the 500 internal server error solved in 6 steps:1. Turn on debuggingWhenever WordPress throws you a white screen of death or a server error, I recommend turning your debugging on. While this may not fix the problem, it may give you more insight into whats going on.You can turn debugg ing on by editing your sites wp-config.php file. Once youve accessed this file, search for WP_DEBUG within. If you find it, you should be able to set it to true. If you dont see it in there, youll need to create it yourself. Either way, at the end of the day, you should have a line that looks like this:define( "WP_DEBUG", true );Once saved, reload your site to see if anything has changed. If youre 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 doesnt 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 whats going on. Dont forget to turn debugging off once everything is a-ok and youre done with the maintenance!2. Deactivate all plugins an d switch themesIf you have access to your dashboard, you should deactivate all your plugins and see whats what. If your website loads without the server error the issue was with one of your plugins. You can switch them on one-by-one to figure out which one caused the issues.You can also switch your theme to a default, unaltered WordPress theme like Twenty Fifteen or Twenty Sixteen. If the site loads without the internal server error, the issue was within your theme.Ive noticed that quite a few of these errors are actually caused by plugins, so this will be your best bet.3. Check your .htaccess fileThe .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.Use your FTP editor and check if you have an .htaccess file in your WordPress root folder. You may need to make sure your FTP editor lists hidden files before you do this.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.If the error is now resolved, the issue was with the .htaccess file. Try restoring the file and then deleting blocks of it. If at some point the site starts working, you know which block the issue is in. You can narrow it down to a single line like this usually. You can then remove that line or ask your developer or your host for further assistance.4. Increase your memoryIve never personally run into this issue, but Ive heard that increasing your memory limit may help I assume this is more of an issue in shared environments. 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 doesnt, paste the following line into the file:define('WP_ME MORY_LIMIT', '64M');If this works then youve 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. If your host has monitoring available, take a look at your resource usage with various plugins on/off to get a better idea of what is wasting those precious megabytes.5. Ask your hostThere are a few uncommon issues which 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.Or, you might just want to switch to a better host that has servers that are more optimized to run WordPress sites. This doesnt have to be expensive. There are hosts that give you an okay WordPress experience for as little as $0.8 a month.6. Reinstall WordPressI shouldnt 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.To get this done, I recommend following the manual WordPress Update instructions in the WordPress Codex, or ThemeIsles own guide to installing WordPress.SummaryInternal server errors in WordPress are usually not caused by actual server faults. 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.I always recommend switching on debugging while youre working things out and ruling out plugin and theme issues since this is what any support technician would ask your to do first, or they would do it themselves. How to fix the 500 internal server #error in #WordPress 🠤â"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.