MainelyDesign.com Blog

Debugging 500 errors

Posted on 06/25/2014 at 02:04 pm by Kevin Wentworth
Viewed 8,975 times | 0 comments

500 errors are notoriously vague errors that can occur for a number of reasons.  Technically the 500 error is defined as an internal server error.  This does not tell you much but it does tell you that you NEED MORE INFORMATION.

How you get that information is from your error logs.  You may look in your application error logs but they will not contain PHP and Apache errors.  Because it is Apache that throws the 500 error, you should start by looking at the apache logs.

In WHM/Cpanel/CentOS the apache logs will be found in /usr/local/apache/logs.

Please note however, that your "sys-admin" may have cleverly hidden the apache logs elsewhere as this is a build configurable path, so it may require additional research to locate them.

Assuming that you have located the log files,  it will now be necessary to reproduce the problem so that a new entry is appended to the error log. 

Error logs tend to be quite large,  Rather than using VI or MORE to view the file it is more efficient to use the TAIL command to view the last entry or last several entries.

This tail command example when executed in /usr/local/apache/logs will display the last 10 entries in the error_log file.

#tail -10 error_log

In this instance the tail command produced in the results the following lines.


[Wed Jun 25 12:25:53 2014] [warn] [client 198.255.231.10] mod_fcgid: read data timeout in 40 seconds, referer: https://www.blah.com/avenger/searches
[Wed Jun 25 12:25:53 2014] [error] [client 198.255.231.10] Premature end of script headers: index.php, referer: https://www.blah.com/avenger/searches
[Wed Jun 25 12:26:00 2014] [warn] mod_fcgid: process 3831 graceful kill fail, sending SIGKILL

This was valuable information as it directly led us to discover that the default FastCGI timeout was 40 seconds,  increasing the timeout resolve many troubling issues on our server.

Bookmark and Share

Tags for Debugging 500 errors

Apache | Errors | Web Server Admin

Comments for this Posting

No comments. Be the first to post a reply.

Sorry, comments are closed for this posting.

Please Email Kevin if you have any questions. Thanks!

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design