Website Help
Stats and Errors
Why do I receive HTTP Error 500 - Internal server error?

Why do I receive HTTP Error 500 - Internal server error?

There are a number of reasons that can cause such an error.

If you have a WordPress installation, you can try to easily fix your 500 Internal server error by watching the solution in our short video:

Alternatively, you can try checking the server error logs. Customers can do this via Site Tools > Statistics > Error Log. There you will see a list of the last error messages generated by your website. In this list, you will find information about each error including:

  • The date and time of the error.
  • Description of the error.
  • Information about which folder or file is possibly generating the error.

Here are some examples of the most common issues that can generate a 500 Internal Server Error:

[Mon May 29 10:34:16.770700 2017] (13)Permission denied: [client] 
/home/user/public_html/.htaccess unable to check htaccess file, ensure it is readable

The error above is mostly caused by incorrect permissions of the .htaccess file or the folder it is in (in the example below that would be the public_html folder). You need to ensure that the .htaccess file has 644 permissions and your directories have 755 permissions. To modify the files/folders permissions use SSH, FTP, or File Manager in Site Tools.

[Mon May 29 10:34:16.770700 2017] [client] /home/user/public_html/.htaccess:
 Invalid command, perhaps misspelled or defined by a module not included in the server

The error shows that there are incorrect directives inside the specific .htaccess. Make sure to revert any recent change with the .htaccess, as they are the most probable cause.

[Tue May 30 04:22:08.084009 2017] [core:error] [pid 23000] [client] 
End of script output before headers: filename

This error happens when the permissions of one of your files are too open. In the example above, filename would be the name of the file in question. To resolve it, change the permissions of the problematic file to 644. These are also the recommended permissions for all your website files.

[Thu Apr 19 01:47:39 2017] [client] Premature end of script headers: 

There are multiple reasons for this error to occur, caused by a large variety of different factors. Nevertheless, most often it is the result of having a very large file as a part of your website. On SiteGround’s shared hosting servers there is a size limit for files that can be opened through the web. The limit is 2GB, and if your website includes a larger file, this will result in the above error.

Check your website’s files either via SSH, FTP, or the File Manager to locate the one causing the problem. Very often these are logs with PHP errors. On SiteGround’s servers, a log file is created automatically if your site’s PHP scripts produce any non-critical errors or warnings during their execution. The log file’s name is php_errorlog and it is located in the same directory as the script that produced the errors. Usually, this would be your site’s directory.

Share This Article