fb-pixel

500 error: how to solve

Published in:

by:

The error 500 can prevent you from accessing a page or website. When this error occurs, in fact, the server sends an HTTP error 500 status code to the browser to communicate a generic problem that prevents you from reaching the requested address.

When error 500 prevents you from reaching a site, the solution is to try again later when the problem has been resolved.

But what if error 500 occurs on your site? There are several checks you can do to try and fix it as soon as possible, so you won’t have a negative impact on your site visits and, more importantly, sales.

In this article,500 error: how to solve it, we’ll see what kind of problem is behind a 500 error. We’ll look at the possible causes and see what solutions you can implement to quickly fix the error and get your site back online.

To top it off, we will also see how to get around the error 500 in case you are not the owner of the site, but just want to access a temporarily unreachable resource.

What is Error 500?

The definition of Error 500 given by the IETF (Internet Engineering Task Force) is as follows:

Status code 500 (Internal Server Error) indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. (RFC7231)

500 Error

So let’s start in order, what is an HTTP status code?

To allow us to reach an address, the browser must send a request to the server on which the site is hosted. The server, in response, returns a code to communicate the outcome of the request.

HTTP status codes are composed of 3 digits, the first of which indicates the category:

1XX: status codes starting with 1 are the informational ones. They indicate that the request has been received and they have yet to process it.

2XX: these codes are the confirmation codes, meaning that the request has been received and processed.

3XX: these are the redirection codes that are used when a resource has been moved temporarily (redirect 302) or permanently (as in the case of redirect 301)

4XX: these codes indicate client errors, such as error 403 and error 404 indicating a resource not found.

5XX: this is the category of server errors. It includes error 502 bad gateway, 504 gateway time-out and error 508, as well as error 500.

So these are the five categories of standard HTTP status codes. Then there are other codes that are always in decimal form and provide further details about the status of the request.

An example is given by Microsoft IIS (Internet Information Services) servers which in the case of error 500 allow getting more specific about the causes of the error.

  • 500.0: the error is in a module or in ISAPI
  • 500.11: one of the applications on the server is about to be stopped.
  • 500.12: an application is about to restart.
  • 500.13: server overload
  • 500.15: request for global.asax file not allowed
  • 500.19: configuration data is not valid
  • 500.21: one of the modules was not recognized
  • 500.22: the configuration of an HTTP module of an ASP.NET web application is not valid in Managed Pipeline mode
  • 500.23: the configuration of an HTTP handlers element of an ASP.NET web application is not valid in Managed Pipeline mode
  • 500.24: problems with the configuration of an identity change in Managed Pipeline mode
  • 500.50: there was a rewrite error when processing the RQ_BEGIN_REQUEST message
  • 500.51: there was a rewrite error while processing GL_PRE_BEGIN_REQUEST message
  • 500.52: there was a rewriting error while processing the message RQ_SEND_RESPONSE
  • 500.53: there was a rewriting error while processing the message RQ_RELEASE_REQUEST_STATE
  • 500.100: the error occurred within the ASP application.

Error 500 can occur in a number of ways, here are some of the most common variations you may come across:

  • 500 Internal Server Error
  • HTTP 500 Internal Error
  • HTTP Error 500
  • Internal Server Error
  • The website cannot display the page
  • HTTP 500 – Internal Server Error
  • Internal Server Error 500
  • 500 Error
  • 500 Server Error
  • 500 Internal Server Error. Sorry something went wrong.
  • Temporary Error (500)
  • Server Error 500 internal
  • Error 500 HTTP
  • Error 500 Internal Server Error
  • HTTP Error 500
  • An error occurred during data request (500)

The error message can change from one server to another and on different browsers. In the screenshot below you can see an example of the error on Google Chrome.

500 Error This Page Isnt Working

Other browsers, such as Firefox, however, may also simply show you a white screen like this.

500 Error Blank Page

Causes of error 500

Error 500 can result from several causes ranging from an error in the .htaccess file to server unavailability due to maintenance. In this paragraph, we will examine some of the most common causes that can generate this type of error. In the next one, instead, we’re going to see how to proceed step by step to solve it.

Errors in the file .htaccess

The .htaccess file is used to insert directives for Apache servers. For example, you can use the .htaccess file to implement 301 redirects.

The presence of an error, such as an incorrect command or even a syntax or writing error, within this file, can cause the server to respond with an error 500.

Permissions errors

Permissions can be set for all files and folders on the server. This determines which users are granted permissions to read, write and execute files.

For example regarding permissions for WordPress files and folders you should use the following permissions:

  • 644 or 640 for files
  • 755 or 750 for folders.

An error in permissions can be the cause of a 500 error.

Problems with a script

An error in the syntax or code of a script, but also in the path setting can cause a 500 error. Also, you may have problems with Perl scripts if they were loaded in binary mode instead of ASCII, or if the necessary modules were not installed.

Problems with the server

Error 500 may be due to problems with the server, for example, if there is an overload on the server or due to maintenance. In these cases, you can wait and try to reload the page after some time or contact your provider.

Compatibility problems with plugins and themes

When using a CMS with extensions, plugins, or themes, a common situation you might find yourself in is a 500 error right after installing one of these components.

To quickly figure out if the cause of the 500 error is a plugin you can disable all of them temporarily. You can do this directly from the dashboard, but if you can’t log in, there are other methods as well, which we’ll see later in the section on Error 500 solutions.

Problems with WordPress core files

Although error 500 is not directly related to the platform you’re using, there are cases where the problem can stem from the CMS files.

For example, in the case of WordPress, it is possible that the core files have been damaged and need to be restored. In this case, you’ll have to proceed to reinstall WordPress without losing the content you’ve created so far.

Keep in mind that it is essential to make a backup before proceeding, to avoid losing your content.

Database problems

A 500 error can result from a problem with the database. Among the most common causes for which you may find yourself having your site down are:

  • wrong credentials to access the database
  • corrupted database
  • database server overload.

PHP memory limit

If a script exceeds the memory threshold, the process is inhibited and you may be faced with a 500 error.

500 error: how to solve it

In addition to looking at the possible causes, we just saw there are other checks we can do to determine the origin of error 500. First, let’s start by analyzing the log files, and then see how to practically fix the common problems we saw earlier.

Check the log files

The cause of error 500 may not fit into the list of common causes we just reviewed. That’s why one of the first things to do is to go and check the server’s error logs or logs.

Access the site’s files, for example through the cPanel file manager, and look for a file like this “error_log”:

500 Error File Manager View Error Log File

With WordPress you can also enable debug mode by adding this code to the wp-config.php file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Check file and folder permissions

You should make sure that files and folders on the server have proper permissions. For example in the case of WordPress, files should have permissions 644 or 640, while folders should be 755 or 750.

You can check and possibly change the file permissions in several ways. For example, you can use the cPanel file manager. With all our shared hosting plan, WordPress hosting, VPS cloud hosting and dedicated servers you can conveniently manage your site files from the file manager.

Next to each file, you’ll see a column that says Permissions and indicates the permissions of the file. In this example, all files are set to 644 and folders to 755.

If you want to change the permissions just click on the number corresponding to the file you want to change, type the new code and click on Save as you see in this screenshot:

500 Error Edit Permissions In Cpanel

You can also change file permissions with an FTP client. For example, you can see how to do it with Filezilla, in our guide dedicated to one of the most used FTP clients.

500 Error File Permissions Filezilla

HTTP error 500 and problems with the .htaccess file

As we said before, one of the causes of an internal server error can be an error in the .htaccess file.

To check if the .htaccess file is the cause, all you have to do is rename it temporarily. You can always do this using the file manager or by accessing the server via FTP.

If you use cPanel’s file manager and can’t find the file, you’ll have to check the settings and make sure the Show hidden files (dotfiles) option is enabled.

500 Error Show Hidden Files In File Manager

Once you have located the .htaccess file, simply rename it and see if the error 500 has been resolved.

500 Error Rename Htaccess File

If the error 500 no longer appears after renaming the .htaccess file, you will need to locate and correct the error in it. After that, you can rename the file back to its original name (.htaccess).

Change PHP memory limit

If one of the active processes on your site is exceeding the PHP memory limit, you may see an error 500.

In this case, you can change the memory limit to see if this is the cause of the error. There are several ways to do this, one of the easiest is to proceed directly from cPanel.

After logging into cPanel click on Select PHP version from the Software section.

500 Error Select Php Version

This tool allows us to change the PHP version and modify the memory limit.

Click on the Options tab and scroll down to memory_limit, then set the PHP memory limit according to the options the drop-down menu allows you.

500 Error Edit Php Memory Limit

Deactivate plugins

Sometimes activating a new plugin or theme can cause a 500 error. To figure out if the cause of the error is a plugin you can temporarily disable all plugins and see if the error gets resolved.

You can deactivate WordPress plugins in several ways: from the dashboard, through the control panel (or via FTP), but also using phpMyAdmin or through WP-CLI.

After deactivating all plugins check if the 500 error has been resolved. In this case, you will have to reactivate the plugins one by one and check if the error reoccurs to find the responsible plugin.

Disable plugins from the dashboard

The easiest way to deactivate all plugins is to do it directly from the dashboard:

  • check the box to select all plugins
  • from the Group Actions drop-down menu choose Deactivate
  • then click on Apply button and all plugins will be deactivated.
500 Error Deactivate WordPress Plugins

If you can’t access the dashboard there are other ways to disable plugins.

Disable plugins from file manager

You can disable all plugins by simply renaming the folder that contains them. You can access your site files from cPanel file manager or by using an FTP client like Filezilla.

Usually the path to the plugins folder is this: /public_html/wp-content/plugins. Rename it, as you see in this example and check if error 500 still occurs.

500 Error Reneme Plugin Folder

After that you’ll have to rename the folder again, using the original name and you’ll be able to manually reactivate plugins from the WordPress dashboard.

Disable plugins with phpMyAdmin

We can use phpMyAdmin to deactivate plugins directly from the database. In this case, remember that before making changes to the database it is always wise to create a backup.

To deactivate plugins we just need to open the wp_options table and edit the active_plugins record inserting a:0:{} inside the option_value.

You can follow the procedure step by step in our guide to phpMyAdmin for WordPress.

Disable plugins with WP-CLI

WP-CLI allows us to manage our WordPress installations from the command line. With one command you can deactivate all plugins:

wp plugin deactivate --all

Also in this case you can check if the error depends on one of the plugins and go to reactivate them one by one from the dashboard.

Contact support

If you can’t find the cause of the error 500, you can always contact support, indicate the checks you have already done and find a solution to the problem with support.

Alternatively, if you want to entrust the technical management of the site to a team of professionals, you can consider switching to a managed WordPress solution. In this way, the resolution of errors of this type, as well as the maintenance operations of your site will be entrusted to experienced hands.

How to solve as a user

The solutions we have seen can be applied in case the error 500 occurs on your site.

If, on the other hand, error 500 appears on the site you are trying to visit, there is little you can do.

Since this is a server-side error, it does not depend on your connection or the device you are using. In fact, if you try to it access from another device or browser, you will find yourself facing the same error.

You can try to check the status of the site with a free service like Down for Everyone or Just Me that allows you to understand if the site is online or not.

In such cases, then, you just have to wait and try to connect to the site again later. If you need to access the content of the page, you can always take advantage of the Google cache to access the version of the site stored in the search engine cache.

Conclusion

As we have seen in this article,500 error: how to solve it, the error 500 is a server error that occurs when something goes wrong and makes it impossible to reach the desired site.

Since it is a generic error, the browser doesn’t offer more information about what caused the problem, it just shows the HTTP error 500 status code, or in other cases, it just shows you a blank screen. For this reason, the only way to solve it is to rule out possible causes one by one.

In this article, we’ve seen what the most common causes of error 500 are, and we’ve looked at possible ways to fix it in case the problem occurs on your site. If, on the other hand, you come across the error while you visit a site, there’s a little trick you can use to still access the resources you were looking for.

Have you ever seen an error 500 on your site? How did you solve it? Let me know in the comments below if the solutions in this article helped you solve it or if you had to use some other method, so we can add more solutions to help out our readers.


Try one of our hosting plans for free and without obligation for 14 days. No payment information required!

Comments

Leave a Reply

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