The purpose of a website is to provide information or a service permanently on the internet. So when a 500 error occurs, the situation is often problematic. Because this internal server error can make one or more pages unavailable, depending on the extent of the malfunction. To resolve this, it is necessary to accurately identify the origin of this HTTP code in order to adopt the most appropriate fix.
> Find out how to perform a technical SEO audit with this free guide.” align=”middle”/>
HTTP error 500: what is it?
A 500 error indicates an internal server problem. It can be due to the host or related to a malfunction of the site concerned. This HTTP error code is displayed in a user’s browser when the latter cannot access a viewed URL. The visitor can then read “error 500 internal server error”.
What are the potential causes of a 500 error?
If the consequence of a 500 error is the unavailability of a URL, its causes may be related to the hosting of a website or a malfunction on it. To identify the origin of the problem with precision, it is necessary to adopt an empirical approach and thus start by verifying whether the error affects all Internet users or only some. The Down for Everyone or Just Me site allows you to perform this check and quickly diagnose the availability status of the submitted URL.
If this URL is indeed unavailable to everyone, the cause may be linked to the server whose status must be checked by contacting the site host. But if everything is in order and the resources are available, it is certainly the site itself which is the cause of the error 500. So, we must look for the origin of the problem on the site, starting with the file. .htaccess and scripts. Then make sure that an update of plug-ins or of the site theme did not cause the error 500. For e-commerce sites, permissions are sometimes the cause of this malfunction. Finally, the origin can also be linked to the names of files and directories which are no longer the same as those of the URL.
How do I resolve a 500 error?
Contact your host to restore an unavailable server
On the website of the host or in the cPanel, it is possible to consult the status of the server where any problems it may encounter are listed. If it turns out that it is experiencing a difficulty, then you must contact the host, even if it is quite possible that the latter is already informed by its alert systems.
But server errors are very rare, and when they do occur, they rarely impact hosted websites. Indeed, the vast majority of quality hosts use several data centers where the sites are duplicated. So, when a problem occurs with one of them, the other takes over. If the owner of a site notices frequent HTTP 500 errors related to the server, it is because the hosting is not qualitative and it is necessary to change it.
Increase the limits of available resources
If a message HTTP error 500 appears, it may be related to server resources assigned to a website, including WP-Memory-Limit, PHP-Timeout, and PHP-Memory-Limit. Indeed, some sites require more resources than others and it is necessary to adjust these parameters to the needs of each one. In this case, increasing the limits will solve the 500 error problem. This increase, which is explained in the PHP manual, is done directly in the cPanel where all the variables can be modified.
Fix the .htaccess file to resolve a 500 error
One of the most common cases is a 500 error due to misconfiguration of the .htaccess file. This one is complex for the uninitiated and it is easy to make a mistake which will cause all or part of the site to be unavailable. To resolve this 500 error, you must first take an interest in the rewrite rules that appear in “rewrite” in this file. An error can easily have crept in and it will often impact many URLs. If everything is fine, you should then look at the recently modified lines before the error occurs. By reverting to their original version, the problem can be corrected as well.
Remove or fix problematic scripts
CGI / Perl scripts can also be the source of a 500 error. In this case, they should simply be deleted if they are not necessary. But if this is not the case, the error could also be due to incorrect encoding of these scripts. This problem can be solved by using a quality editor like Notepad ++ on PC or TextWrangler on Mac. Indeed, unlike a standard editor like Word, this software specializes in editing code, especially that used in scripts. Moreover, it is possible to configure them for a specific programming language.
Check files and directories to correct a 500 error
By modifying a directory or a file, it is possible that certain URLs become unavailable and then present a 500 error. Indeed, the URLs reflect the path to be taken to reach a certain web page. Thus, when the name of one of them is modified but this change is not also made in the links of a site, the Internet user may encounter an HTTP error 500. To correct this, you must either accept the modifications made, or verify by uploading all the files and directories linked to the URL in error 500. By correcting the modifications or the impacted links, the error will be resolved.
Disable plug-ins to check their compatibility
A conflict between different plugins or with the theme can often cause an internal server error. In this case, it suffices to deactivate or even delete the plug-in installed before the 500 error occurs. If it is not possible to identify a precise moment, then they should be deactivated in turn until the URL is functional again. Of course, it is necessary to systematically clear the cache of the website and the browser to see the result. To avoid facing this kind of problem, it is better to consult the list of plug-ins compatible with the theme which is provided by its creator.
Resolve a 500 error related to the site theme
A theme can cause a 500 error as soon as it is installed and, in this case, it is often related to the limits of the PHP resources allocated as mentioned previously. But the message “HTTP error 500” can also appear on the screen after an update. In this case, the preferred approach is to contact the creator of the theme to inform him of the problem encountered. It is very likely that many other sites are also impacted by this unavailability and the creator of the theme will be the most able to provide an effective and lasting solution.
Ensure that the right permissions are assigned in e-commerce
This last cause of error 500 only occurs on e-commerce sites like those created with PrestaShop. Indeed, on these sites files have permissions in order to carry out different actions or interactions. Most of the time, problematic directories or files have the 777 permission when they should never be. To remedy this, just review all permissions and identify those with the wrong code. By passing them to 775, the unavailability error will be corrected.
To go further, download this free e-book which contains all the tools, information and strategies essential to make technical SEO one of the pillars of optimizing the performance of your website.