Recent Posts
- (09/10) Fixing Warning: the ECDSA host key for 'github.com' differs from the key for the IP addressTAGS:Web Server Admin
- (12/26) CakePHP 3 - Getting List of Column Definitions from a Table (like schema())TAGS:CakephpCake3
- (09/14) Change Order of Loaded Behaviors in CakePHP 3TAGS:Cake3CakephpWeb ProgrammingPhp
- (05/29) CakePHP 3 - Accept JSON Header Only Working When Debug FalseTAGS:Web ProgrammingCakephpCake3
- (05/23) Remove All Events from Google Calendar (Reset Calendar)TAGS:Web ProgrammingPhp
- (11/08) Google Tag Manager (GTM) Not Firing Default PageView EventTAGS:Web ProgrammingJavascriptGoogle Tag Manager
- (10/13) In PHP, how do you get __toString() Magic Method Result without calling echo?TAGS:CakephpCake3Cakephp 13PhpWeb Programming
- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
Subscribe to my feed
MainelyDesign.com Blog
Debugging 500 errors
Posted on 06/25/2014 at 02:04 pm by Kevin Wentworth
Viewed 9,471 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.
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!