What is Http Internal Server Error 500 and How to Fix It?

At some point in time, you must have encountered a 500 Internal Server Error while trying to access a particular website. As a visitor, you may ignore it, but as a website administrator, you cannot afford to ignore it and get rid of it as soon as possible. As not only the website frontend but also the WordPress administrator dashboard might not be available to access. In this article we will walk you through some of the reasons why this error occurs, and how to avoid it, and why it is important to invest in a reliable web hosting server to avoid this error and improve the website uptime.

 

The frequent occurrence of 500 HTTP error is bad for the reputation of your business and will lead to visitors losing trust in your brand. Besides the reputation, it will also hurt your search engine rankings. Hence it is advised to avoid this error, and deeply understand what it is all about and how to troubleshoot. Sometimes it could be due to the problem in website configuration, while sometimes it has something to do with issues at the server, which might be beyond your control.

 

So let’s move forward, In this article, we will cover the following topics –

What is an internal server error?

http 500 internal server error

In one of our previous articles about HTTP Status codes, we have covered in detail the type of errors website users might encounter. The 3 digit error status code that starts with ‘5’ and looks like 5XX indicates that there is no problem with the request made by the user agent, but due to some of the other reasons the server is not able to process the request due to incorrect configuration of the website or due to some issue encountered within the server. While 500 specifically indicates that the webserver is facing some kind of an Internal issue due to which the request made by the user agent could not be processed at that moment. Sometimes this kind of error is momentary, which lasts for a few minutes and sometimes just a few seconds.

 

But if the problem persists, chances are that there is a problem with the website. Also, it is found that often the issue arises due to incorrect configuration of the website, which you can fix at your end. 

 

But if this is very frequent you should discuss the problem with the webserver tech support team to help you troubleshoot the issue. Some other popular 5XX errror codes are 502 Bad Gateway error, 504 Gateway timeout error

 

For a more specific kind of issue, you need to look into the specific error code using tools like MS IIS. Some of the most commonly occurring codes are as shown below:

 

Code List of 500 Internal Server Errors

Code Explanation
500.11 The application is crashing down on the webserver when a request is made by a user agent.
500.12 The application is under the restart process on the webserver.
500.13 The web server is too busy with other requests. In other words, it is overloaded with a large number of requests, which is more than its capacity.
500.14 Invalid application configuration on the server. The WordPress website installation is incorrect or corrupted.
500.15 Direct requests for GLOBAL.ASA are not allowed.
500.16 UNC authorization credentials are incorrect.
500.17 URL authorization store cannot be found.
500.18 URL authorization store cannot be opened.
500.19 Data for this file is configured improperly in the Metabase.
500.2 URL authorization scope cannot be found.
500.21 Module not recognized.
500.5 A rewrite error occurred during RQ_BEGIN_REQUEST notification handling. A configuration or inbound rule execution error occurred.

How to Fix 500 Internal Server Error in WordPress?

If there is a 500 internal server error on your WordPress website the users will not be able to access any of its pages, which indicates that there could be a problem at the root directory. Here are some of the most common issues due to which your WordPress website is having an HTTP 500 Internal Server Error.

#1 – Corrupt .htaccess file

One of the most common causes of WordPress 500 error is a corrupted .htaccess file (found in the root directory) that might arise due to a plugin update, theme update, etc. or during the migration from one server to another. To fix this error you can replace the current htaccess file with another one. Sometimes you might not be able to see .htaccess file, in such case check the hidden files in the root directory as well. Also, make sure that the file is correctly named.  Read everything about htaccess file in wordpress here.

#2 – Exceeding PHP Memory Limit 

This could happen due to some plugin or theme consuming a lot of processing memory, or if you are using too many plugins. Basically, if your WordPress website is consuming a lot of memory to process a request you might run out of memory limit. You can increase the memory limit to troubleshoot this problem. This could be done by doing some modifications in the wp-config file or php.ini file. 

 

Add this code in wp-config file:

image4 1 What is Http Internal Server Error 500 and How to Fix It?

 

You can increase the memory limit by changing 64M to 128M, 256M, and so on.

 

Alternatively, you can increase the memory limit through php.ini. Edit your php.ini, find out the line of code that defines the memory limit which will look like this:

 

memory_limit = 32M ; 

You can increase it to 64M, 128M, 256M and so on.

 

Another related issue is with Maximum Execution Time. If a request made by the user agent takes more than the time limit set for the website process request. You can increase the max execution time limit either through wp-config file, or .htaccess file or php.ini file.

 

To define the Max Execution Time using wp-config, add the following code or if the code already exists increase its value:

set_time_limit(300); 

 

To increase the time limit using .htaccess file, add or edit the following code:

php_value max_execution_time 300

 

You can edit php.ini as well to increase the execution time using this code:

max_execution_time = 300

 

#3 – Faulty Plugin or theme Issue

If you have recently installed or updated a plugin you might need to investigate if that is causing an issue. If you are able to access the admin dashboard, you can deactivate all the plugins at once, and then refresh the website to check if it works now. If it works to reactivate the plugin one after the other and check after activating each of the plugins. That way you will be able to identify which plugin is causing the issue. If after deactivating the plugins the website is still not working then the issue is obviously not due to any of the plugins.

 

If you are not able to access the admin backend you can rename the directory of each of the plugins, and while doing so you can check the website after renaming each of these and see if the problem resolves. Also, it is recommended to keep all the plugins updated.

 

Try updating or switching the theme of your WordPress website and see if the internal server error is gone. Sometimes outdated or corrupt scripts and codes within the theme files can lead to an internal server error. If you have encountered this error after theme update, report this to the theme developer, and restore it to a previous version. That is why it is recommended to take regular backups of your website, especially before making themes, plugins, or core installation updates.  

 

Some hosting providers also provide you with Error logs that might help you further identify the cause of the error.

Wpoven
Wpoven

 

Hosting providers like WPOven provide you with a console within your hosting console to update the plugins, themes, core files, and many other management tools for better performance and control over your website along with regular backup and restore options.

 

#4 – Corrupted Core Files

You can upload the updated files through an FTP server to troubleshoot the internal server error on your WordPress website. You can upload the updated files from WordPress.com and upload them to the server using FTP software like fillzilla etc.

#5 – Check File Permissions

In order to make the WordPress website work perfectly fine, it is essential to have all the directory and file permissions correctly configured. The recommended file permission settings are as follows:

 

  • 755 for all folders and sub-folders.
  • 644 for all files.

 

Incorrect permission settings will lead to the blocking of some plugins, themes, and scripts to work. 

 

At WPOven you can use “Fix Permissions” tool for fixing file permissions in Sites->Tools in dashboard. 

 

At WPOven you get –

  1. Dedicated Server with every plan
  2. FREE SSD Storage
  3. FREE SSL CERTIFICATE
  4. FREE Business Email
  5. FREE Over 100 premium themes and plugins
  6. FREE Daily Off-Site Backups
  7. FREE Malware Screening & Cleanup 
  8. FREE WordPress Dev & Server Support

#6 – Unsupported PHP Version

There are outdated PHP versions that are not supported by the latest WordPress version anymore. One of the latest versions like 7.0, 7.1, 7.2, 7.3, and 7.4 are highly recommended. You can refer to our article on PHP Versions as well for more details.

 

Also, you can find about the latest PHP 8 version here.  WPOVen – Managed WordPress Hosting Comes with the latest PHP Updates.

#7 Incorrect DNS entries

If your DNS is pointing to a server other than your hosting server, the visitors will not be able to access it. Make sure that the DNS entries are accurate.

#8 – Problem with Server itself

If none of them work you should immediately contact the tech support team of your web hosting provider to troubleshoot. There might be a problem with either the server hardware or the software. If there are frequent outage reports at the server end you should consider switching to another company.

Check out our article on WordPress Security here

Tips to avoid Internal Server Error and Quick Troubleshoot

  • First and foremost, keep all the plugins, themes, and WordPress Core updated. The outdated versions tend to create more problems and are more prone to security threats like malware and hacking.
  • Always take regular backups of your WordPress website files and database. Use a good plugin that takes regular backup and can easily restore the website to the desired version.
  • Turn on ‘Debugging’. It is a small trick that will help you easily debug the website, by giving you vital information about the cause of the issue. It can be enabled by adding the following line of code in your wp-config file: “define( “WP_DEBUG”, true );”
  • Increase your PHP Memory Limit (as explained above).
  • Use a highly reliable server.
  • Use security plugins to scan and audit your website regularly.
  • Use reliable and trusted plugins and themes only, that provide good support.

 

Some of the top web server hosting companies like WPOven have a system in place to keep a close watch on the hosted WordPress websites and send out a notification to the website administrator. There are some free web-based website monitoring tools like UptimeRobot, that also sends notifications in case the website is not working for any reason.

 

Steps for troubleshooting of 500 Internal Server Error.

Step 1: Reload the page, sometimes there is a momentary issue with the server, so a simple reload of the page will get you to the page.

Step 2: Clear Browser Cache: Using Hard Refresh (Ctrl + F5) you can clear the cache, moreover you can go to browser history and clear the browser cache.

Step 3: Try accessing the wp-admin backend of your WordPress installation.

Step 4: If you are able to access the admin dashboard, deactivate all the plugins to see if it resolves the problem. If it does, start reactivating the plugins one by one to identify the one creating the problem. Obviously you have to get rid of that plugin. Before doing this make sure that all the plugins are updated to the latest version.

Step 5: If you are unable to resolve the issue, switch the theme to default one, if it resolves the issue you will have to update the theme or change the theme. Probably some of the theme files could get corrupted, hence you can re-upload the files.

Step 6: If the problem persists, check the .htaccess file, file permissions, as well as (as explained above), 

Step 7: If the problem still continues to contact the tech support team to help you resolve the issue and make your website live.

Where can you see an internal server error? 

HTTP 500 Error on a WordPress Website:

If your website has encountered an internal server error, you will not be able to access the website. In extreme cases, you might not be able to access even the wp-admin backend.

 

Typically, your browser will show any of the following messages:

 

  • “500 Internal Server Error”
  • “HTTP 500”
  • “Internal Server Error”
  • “HTTP 500 – Internal Server Error”
  • “500 Error”
  • “HTTP Error 500”
  • “500 – Internal Server Error”
  • “500 Internal Server Error. Sorry, something went wrong.”
  • “500. That’s an error. There was an error. Please try again later. That’s all we know.”
  • “The website cannot display the page – HTTP 500.”
  • “Is currently unable to handle this request. HTTP ERROR 500.”

500 Error on Linux:

If your website visitors are getting the 500 HTML error status you can troubleshoot it using Linux as well, especially if the error arises due to any of the CGI or PERL script. Also, the error can be due to the non-compatible versions of PHP and Apache. In such a case you need to upgrade PHP or recompile Apache. In Apache you can go through the error logs in the following locations:

 

/usr/local/apache/logs/error_log

/usr/local/apache/logs/suphp_log

 

You can use Linux commands to fix the errors, for example, to change the file and folder permissions you have to use following commands:

 

cd public_html

find . -type d -exec chmod 755 {} \;

find . -type f -exec chmod 644 {} \;

Though there are lesser instances of 500 internal server errors on the world’s most visited website, even then they have encountered the error at some point of time. Some websites have very creatively designed the error pages as well. Some of the examples are shown below:

  • FitBit.com:

image2 2 What is Http Internal Server Error 500 and How to Fix It?

  • Amazon

amazon internal server error

  • Disney

internal server error example

  • GitHub

http 500 internal server error

 

Some of the leading Content Delivery Network providers like Amazon’s AWS offer to create a custom page when there is an internal server error.

Nonavailability of websites, or in other terms longer and frequent downtime of the website can negatively impact your search engine rankings. Google always strives to provide good user experience to the visitors, and hence if many visitors encounter the problem at different points of time it will downgrade the ranking of the website for sure. Hence it is important to take these errors seriously and keep monitoring the websites. Using Google Analytics as well as Search Console you can see how many visitors faced the error. Besides the user experience, Google crawler also crawls the website regularly, and while crawling it found that the website is not available on a consistent basis it will negatively affect the rankings.

Conclusion

The seriousness of the 500 Internal Server Error depends on how frequent the error occurs, and the cause of the error. If the error lies with the website files or configuration then you need to fix it or take professional help. But if the error is frequently occurring due to some problem with the server’s hardware or software then you need to immediately migrate to a more reliable and trusted hosting company

Leave a Reply

Your email address will not be published. Required fields are marked *