How to correct a 500 error on your site with LWS Panel

Procédure

Introduction

The dreaded 500 Internal Server error. It always seems to pop up at the most inopportune moment, leaving you suddenly searching for solutions to get your site back online. We understand this situation perfectly, because we've all experienced it.

In this article, we will explore the 500 Internal Server error and provide you with solutions to quickly get your site back online. Find out below what causes this error and how you can prevent it from happening again in the future.

What is the 500 Internal Server Error?

The status code 500 (Internal Server Error) indicates that the server has encountered an unexpected condition that has prevented it from responding to the request.

When you access a website, your browser sends a request to the server on which the site is hosted. The server then takes this request, processes it and sends back the requested resources such as PHP, HTML, CSS, etc., together with an HTTP header. This HTTP header also contains what is known as an HTTP status code. This status code is a way of informing you of the status of the request. It can be a 200 status code, meaning "All is well", or a 500 status code, indicating that an internal server error has occurred.

There are different types of 500 status error codes (500, 501, 502, 503, 504, etc.), each with a different meaning. In this case, a 500 Internal Server error means that the server has encountered an unexpected condition that prevents it from responding to the request.

Variations of 500 Internal Server errors

In the case of a problem with an .htaccess file, you will generally get this error page:

How to correct a 500 error on your site with LWS Panel

Generally speaking, the classic 500 error message is :

How to correct a 500 error on your site with LWS Panel

Most Common Causes of Error 500 Internal Server :

There are many possible reasons for the 500 Internal Server error. If you get one, there's a good chance that one (or more) of the following is causing the problem:

  • Browser cache.
  • Incorrect database login credentials.
  • A corrupted database.
  • Corrupted files in your WordPress installation.
  • Problems with your database server.
  • Corrupt WordPress files.
  • Corrupt .htaccess file and PHP memory limit.
  • Problems with third-party plugins and themes.
  • PHP timing out or fatal PHP errors with third-party plugins.
  • Incorrect file and folder permissions.
  • PHP memory limit exhausted on your server.
  • Corrupt or broken .htaccess file.
  • Errors in CGI and Perl scripts.

Impact of 500 errors on SEO

Unlike 503 errors, which simply indicate that WordPress is in maintenance mode and advise Google to check later, a 500 error can have harmful repercussions on SEO if it is not resolved immediately.

If your site is down for a short period, say 10 minutes, and is regularly crawled, the indexing robot will generally simply remove the page from its cache. In some cases, Google may not even have a chance to try again until the next backup. In these circumstances, everything is under control.

However, if the site is down for an extended period, for example 6 hours or more, Google could interpret the 500 error as a serious problem requiring correction. This could affect your ranking in the search results. If you want to avoid regularly encountering 500 errors, it is essential to understand their initial causes. The solutions suggested below can help you do this.

How do I repair the 500 Internal Server error?

When you encounter a 500 Internal Server error on your site, it can be difficult to know where to start troubleshooting. Generally, 500 errors are related to the server itself, but in our experience, these errors can have two main origins. The first is related to a user error (client-side problem), while the second is associated with a problem on the server.

1. Try reloading the page

It may seem obvious to some, but one of the first simple steps you can take when faced with a 500 Internal Server error is to wait a few minutes and reload the page (F5 or Ctrl + F5). It may be that the server or host is momentarily overloaded and the site will come back online quickly. In the meantime, you can also try accessing the site via another browser to eliminate any problems with your current browser.

We have also found that this can sometimes happen immediately after updating an extension or theme on your site. Generally, this is due to incorrect host configuration. What happens is that they experience a short temporary downtime immediately after the update. However, things are usually resolved within a few seconds, so refreshing the page is all you need to do.

2. Clear your browser's cache

Before you embark on a more in-depth debugging of your site, another troubleshooting step is to clear your browser's cache.

3. Check your server logs

To resolve the problem quickly, it is useful to exploit the error logs. If you are an LWS customer, you can easily check the errors by following this documentation. This can be particularly useful if the problem is linked to an extension on your site.

How to correct a 500 error on your site with LWS Panel

4. Error establishing database connection

500 Internal Server errors can also occur due to a database connection problem. Depending on your browser, you may encounter different errors, but they will all generate an HTTP 500 status code, regardless of the contents of your server logs.

Here is an example of an error that occurs when a database connection fails. The entire page appears blank because no data can be retrieved to display the page due to a database connection problem. Not only does this affect the public interface of your site, but it will also prevent you from accessing the WordPress dashboard.

How to correct a 500 error on your site with LWS Panel

So why exactly does this happen? Here are some common reasons:

  1. Your database credentials are incorrect. Your site is using separate login credentials to connect to its MySQL database.

  2. Your WordPress database is corrupt. With themes, extensions and users constantly being added and removed, databases can sometimes become corrupted. This could be due to a missing or corrupt table, or accidentally deleting some information.

  3. You may have corrupted files in your WordPress installation. This can sometimes be caused by hacker attacks.

  4. Problems with your database server. Several problems can occur with web hosts, such as database overload due to a traffic spike or an inability to respond due to an excessive number of simultaneous connections. This is particularly common with shared hosting, where the same resources are shared between many users on the same server.

5. Check your extensions and theme

Third-party extensions and themes can often be the cause of 500 Internal Server errors. You will often notice the error immediately after installing a new element or running an update. This is why we always recommend using a staging environment for updates, or at least running them one at a time. Otherwise, if you encounter a 500 Internal Server error, you will need to identify the source of the error.

To solve this problem and determine whether an extension is causing a problem, we recommend that you follow this documentation.

Always ensure that your extensions, themes and WordPress core are up to date, and check that you are using a supported version of PHP. If the problem is due to faulty code in an extension, you may need to call in a WordPress developer to fix it.

6. Reinstalling the WordPress Core

Occasionally, WordPress core files can be corrupted, especially on older sites. It is possible to reload only the WordPress core without affecting extensions or themes. However, be sure to back up your data before proceeding.

From the Dashboard -> Updates, you can reinstall WordPress without losing any content:

How to correct a 500 error on your site with LWS Panel

7. Check for permissions errors

A permissions error concerning a file or directory on your server can also trigger a 500 Internal Server error. Here are some standard recommendations for file and directory permissions in WordPress:

  • All files should have permissions of 644 (-rw-r-r-r-r-) or 640.
  • All directories must have permissions of 755 (drwxr-xr-xr-xr-x) or 750.
  • No directory should ever have permissions of 777, even download directories.
  • Advanced: the wp-config.php file could also be configured with permissions of 440 or 400 to prevent other users of the server from reading it.

You can easily view the permissions on each file using your hosting's file manager.

How to correct a 500 error on your site with LWS Panel

8. Increase PHP memory limit

It is possible that this error is due to the PHP version following the update of your script. It is also possible that error 500 is due to a lack of memory allocated to your site. Some PHP scripts require a large amount of memory to function properly. The browser also makes a very large number of requests to load the content, plugins and scripts on your site. As a result, insufficient memory can cause a 500 error. You can test this by changing PHP versions or allocating more memory to your package by going to the administration of your LWS package and then to "PHP Configuration" in the "Database & PHP" section.


How to correct a 500 error on your site with LWS Panel

You will be able to change the PHP version, but also increase the memory allocated"memory_limit" or the value"max_execution_time" on your formula.

How to correct a 500 error on your site with LWS Panel

If this value is already at the maximum, your site may be using too many resources for the formula you have. In this case, you will need to change your formula for a more efficient one.

9. Correct your .htaccess file

The Apache web server has the following directives for .htaccess files:

    Options -Indexes -Includes -ExecCGI -IncludesNOEXEC -MultiViews -SymLinksIfOwnerMatch +FollowSymLinks AllowOverride None AllowOverride Indexes AuthConfig Limit FileInfo Order allow,deny Allow from all  Deny from all   


The following directives are enabled:

  • AuthConfig : Authorisation directives (AuthDBMGroupFile, AuthDBMUserFile, AuthGroupFile, AuthName, AuthType, AuthUserFile, Require, etc.).

  • Indexes : Directives controlling directory indexing (AddDescription, AddIcon, AddIconByEncoding, AddIconByType, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, etc.).

  • Limit: Directives controlling host access (Allow, Deny and Order).

  • FileInfo: Directives controlling document types (DefaultType, ErrorDocument, ForceType, LanguagePriority, SetHandler, SetInputFilter, SetOutputFilter, and mod_mime Add and Remove directives, etc. ), document meta data (Header, RequestHeader, SetEnvIf, SetEnvIfNoCase, BrowserMatch, CookieExpires, CookieDomain, CookieStyle, CookieTracking, CookieName), mod_rewrite directives (RewriteEngine, RewriteOptions, RewriteBase, RewriteCond, RewriteRule) and and Action for mod_actions.


The "Options" directive is deactivated: If this parameter is present in your .htaccess file, it will produce an error. We therefore invite you to comment out all lines starting with this directive ( Add a "#" at the beginning of the line. )

However, the "+FollowSymLinks" option in the "Options" directive is active. This feature is used in many CMS such as Joomla. You can therefore comment out the line associated with this parameter in the .htaccess file without worrying.

We recommend this site, which can help you generate your htaccess file very easily:http://www.htaccesstools.com

To check whether the problem is with your .htaccess file, rename it to .htaccess-test using FTP.

You can also do this using the"File Manager" found in the administration area of your package, in the"File" section.

How to correct a 500 error on your site with LWS Panel

Right-click on the .htaccess file and then on"Rename".

How to correct a 500 error on your site with LWS Panel

Rename the file to ".ancien_htaccess" or"htaccess.txt".

Once you have renamed the file, you need to run a new test on your site to see if it still displays or causes a problem.

If the error disappears, then the problem was due to a syntax error.

Technical help for resolving error 500 - Internal Server Error

Our technical team is available to help you resolve the 500 Internal Server Error on your website.

To request the intervention of a technician, go to your LWS Panel customer area to subscribe to a support option.

As part of the one-time outsourcing service, a specialized technician will call you back within an hour of opening the request and take the necessary action to resolve the error.

Rate this article :

3/5 | 26 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

0mn reading

Cloudflare Error 524 : A timeout occured

10mn reading

How do I correct HTTP error codes?

0mn reading

404 error, what it is and how to correct it

1mn reading

How do I fix the HTTP 503 Service Unavailable error?


Questions sur l'article
Tidiane02 Il y a 515 days
Bonjour j'espère que vous allez bien. je travail en ligne avec le CMS drupal et j'ai un problème au niveau des images qui ne s'affiche pas sur mon site lorsque je les insèrent . merci de me répondre.
See the
1 answers
Benjamin-LWS - Il y a 514 days

Bonjour,

Merci de votre retour.

N'ayant aucun accès à vos données LWS, je ne peux vous dire précisément d'où vient le problème que vous rencontrez. C'est pour cela que je vous invite à passer par notre service support à travers votre espace client pour régler votre problème au plus vite. (Contacter le support LWS)

Je vous remercie de votre attention et reste à votre disposition pour toute autre question ou complément d'information.

Cordialement, L'équipe LWS

Utile ?

Ask the LWS team and its community a question