Technical SEO

How to 5xx Errors

5xx errors refer to problems with a server being unable to perform the request from a user or a crawler. They prevent users and search engine robots from accessing your webpages, and can negatively affect user experience and search engines' crawlability. This will in turn lead to a drop in traffic driven to your website.

By
Jace Thomas
.
July 1, 2022

About this issue

5xx errors refer to problems with a server being unable to perform the request from a user or a crawler. They prevent users and search engine robots from accessing your webpages, and can negatively affect user experience and search engines' crawlability. This will in turn lead to a drop in traffic driven to your website.

How to fix 5xx errors

Investigate the causes of these errors and fix them.

These errors are caused by the server being unable to fulfill an apparently valid request from a visitor. Often, you will need the help of a server administrator to investigate them.

It is also important to consider that quite often, a chain of servers is handling an HTTP request, so that it may not be your server that is returning the error.

When Do 500 Errors Appear in the HTTP Request-Response Cycle?

Your browser, the client, communicates with a web server to display a web page in a process called the request-response cycle. If a problem occurs, the 500 error will appear during the last step of the cycle:

  1. The browser sends out the IP name of the site to the domain name servers (DNS). The DNS provides the numeric IP address for the website.
  2. An IP socket connection opens to the IP address.
  3. The browser sends an HTTP data stream through that socket.
  4. In response, the browser receives an HTTP data stream from the desired web server. If the server is experiencing a problem, this data stream will contain the 500 error code that you view in your browser.

Identifying and Fixing 5xx Responses on a Website

If the 5xx response appear on your own website, it may be difficult to pinpoint the source of the problem. Incompatible upgrades, missing or corrupt files, incorrect permissions, and script errors may be culprits.

If you encounter a 5xx response on your own webpage or site, first try these two things to remedy the issue:

  1. When the error appears, wait for a moment, and then try reloading the page to ensure that the problem was not just a momentary issue.
  2. Check the error log for the website that’s returning the error. (Several websites may be hosted on one server.) Even if you have a hosted website, you can still request a copy of the server log to view the problem.
  3. As a general guideline, the easiest way to troubleshoot a 5xx response may be to think of the last change to your system and then roll it back.

Debugging Your Server Scripts to Solve 500 Errors

Server-side scripts may produce 500 errors. In addition to viewing common HTTP status code errors, you can often turn on additional functionality in server scripting languages to display more detailed messages for debugging purposes. In PHP, for example, use display_errors to log errors or display errors onscreen. In IIS 4.0, clear the Show Friendly HTML Error Messages checkbox to show the developers message. For more information on troubleshooting on IIS, see How web site administrators can troubleshoot an “HTTP 500 Internal Error” error message on IIS 4.0 or IIS 5.0.

When 500 errors appear, check your server scripts for these problems:

  1. Server permission: If permissions are incorrect, a server cannot run a script. For example, permissions for both PHP or CGI script should be set to 0755 (-rwxr-xr-x).
  2. PHP timeout: If the server connects to external services, they may time out. If too many connections time out, a 500 error appears. Review timeout rules and error handling in your script. These can be difficult to find because connections to databases and RSS feeds will stop the script. The easiest solution may be to remove external connections.
  3. Server timeout: Lost server connections, reboots, and too many calls at once can cause a server to timeout. Test the script to ensure this is not happening frequently. 
  4. Structure in .htaccess files: An error in an .htaccess file may prevent a page from loading. To test whether .htaccess is the problem, temporarily remove the file or rename it. Then, reload the page.
  5. CGI and Perl script errors: If a web page with the extension .cgi or .pl returns a #500 error, check the script. Ensure that you save CGI files in pure ASCII format and also that you upload them to the cgi-bin directory in ASCII mode. Also verify that any Perl modules required for your script are supported.

500 Errors on Common Software Platforms and Programs

If you are seeing errors for products such as WordPress, Joomla, or if you present content on a content management system, check the knowledge base and help pages for those platforms.

Written by
Jace Thomas

We can prove that we're right for you.

Drive high-ticket aesthetic and body contouring package sales.