HTTP Error 500 is being shown when visiting web pages
If when visiting one or more of your website's pages, you get an error message including the words
HTTP Error 500
or just
Error 500
here are some things to consider when trying to work out what is happening:
- Did you recently add, change or remove something on your website? For example, did you add or update a WordPress plugin? If so, reverse what you did and see if that makes a difference.
- Have you added or changed some custom code? In some cases, just one typo in a long piece of PHP code can cause a whole website to break.
- Have you been keeping your website up to date so that it works on the latest versions of PHP? If your site was running on a version of PHP which has recently been removed from our servers, you may need to adjust the site so that it works on newer versions of PHP.
- Have you recently edited your .htaccess file or a different configuration file? Simple errors in these files can cause a whole website to fail.
The above is not a complete list of possible reasons but some of the most common ones.
If the error is PHP related (items 1-3 in the list above), the reason for the error is probably contained in your site's PHP error log, unless you have disabled PHP logging for your website. To see the log file, go to File Manager in your cPanel (hosting control panel). The log file should be in one of these places:
1
logs/yourdomain_co_uk.php.error.log
(where yourdomain_co_uk is the site in question. If you only have one site, the domain name may not be part of the file name. Note: the 'logs' folder is in your hosting plan's home folder, not public_html or any website's folder)
2
public_html/error_log
(for your main or only website)
3
yourdomain.co.uk/error_log
(for additional websites)
Match up the exact time you visited your site when you got the error with the relevant line or lines in the log file. Bear in mind that the log file might list its timings in the UTC time zone (AKA GMT or the time in the UK between late October and late March), so you may need to make a mental adjustment to the listed times for the time zone you are currently in, for example British Summer Time (UTC + 1 hour).
The error message should help you identify the problem.
Sometimes, the error is due to the site running out of available memory. An example of this type of error is:
Allowed memory size of 123456789 exhausted (tried to allocate 12345 bytes) in /site/script.php on line 55
This sometimes happens when a site has an inefficiently-programmed component (e.g. a plugin) or when there is a combination of factors such as multiple plugins conflicting with each other or a particularly large database or file structure.
In some cases, a website might have its own PHP memory limit setting which is actually reducing the amount of available memory compared to what is provided by default with your hosting. Look for settings within your website to determine if this is the case.
Occasionally, a site is so big or complex that, even though it is efficiently programmed, it needs more memory than your current hosting plan can provide. This is quite rare because our memory allowances are fairly generous. If you believe that this might apply to your site, please get in touch to discuss your hosting options.
If the error is not memory related and you have tried reversing recent changes, we recommend carrying out online searches for the specific error you're receiving (after having removed anything from the error message which might identify your site) and see if other people have had the same problem and worked out how to resolve it.