How to troubleshoot 500 errors

This guide explains how to troubleshoot 500 errors for customers using LCN web hosting and WordPress hosting

The 500 error is a generic error returned when the web-server encounters a problem and a more specific error message cannot be provided. 

The first step in troubleshooting this error should be to refresh the page to check if the error re-occurs. If the error is a one-off and can’t be replicated, then further investigation often isn’t needed. 

There are many different potential causes for 500 errors and the following steps will help identify the cause: 

Enabling Application Error Logging 

The most common causes of this error is a PHP/application scripting error. Error logging for PHP is disabled by default on our servers. Enabling PHP error logging could help to determine the cause of this error. 

The following page will provide instructions for enabling PHP error logging: How to turn on PHP error logging 

.htaccess Errors 

Another common cause of 500 errors is invalid contents within the .htaccess. If the .htaccess file includes any syntax errors, or if the file attempts to enable directives that are not supported by the LCN hosting platform it may result in a 500 error. 

The LCN hosting platform does not support applying the following directives in .htaccess: 

AddType application/x-httpd-php
ForceType application/x-httpd-php
php_value
php_flag

You can test if the .htaccess file is the cause of a 500 error by renaming the file and allowing 5 minutes for this to take effect. If the error is resolved after disabling/renaming the file and returns after the file is restored, then the error is likely to be caused by the contents of this file. 

Checking File Permissions 

The following pages provides instructions for checking/changing file and folder permissions for your site: 

How to change file permissions via FTP 

How to change file permissions using File Manager

Folder permissions for directories storing web content should be set to 755.
Files outside of the cgi-bin folder should be set to 644.
CGI/Perl script files stored in the cgi-bin folder should be set to 755. permissions

Scripting Errors 

Troubleshooting CGI/Perl script errors 

If you’re encountering a 500 error with a Perl script, the following page will explain the steps to take to troubleshoot these: Troubleshooting common Perl issues 

Perl/CGI scripts should be placed inside the cgi-bin folder for your site and should have permissions set to 755. 

The following script interpreters should be used for Perl/CGI scripts – this may need to be checked if you’ve moved a site from a different server as these paths can vary from system to system: 

The following page will provide details on steps that you can carry out to troubleshoot common PHP script errors: Troubleshooting common PHP issues 

Perl: /usr/bin/perl
PHP/CGI 5.6: /usr/local/bin/php-cgi56
PHP/CGI 7.0: /usr/local/bin/php-cgi70
PHP/CGI 7.1: /usr/local/bin/php-cgi71

Checking system-status for server issues 

You can check our system-status for any known issues that could result in sites returning 500 errors from the following page: System Status  

If we are aware of any server issues that could result in errors with sites, the status on the above page will be updated with details on the fault and an expected resolution time if this can be provided. 

If the above steps don’t help in resolving any 500 errors, you can raise a support ticket for the problem from the support page of your LCN account.  

Please include instructions on how to replicate the error and any login details required to access the page where the error is occurring, as this should help the support team to investigate the problem.

Was this article helpful?

Check out some of our related guides

Need a hand? Search over a hundred step-by-step support guides