Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP not outputting errors?

Tags:

php

My webpage is putting out a 500 Internal Server Error. I've turned on E_ALL for error reporting in the php.ini, and restarted the httpd. I've even used error_reporting(E_ALL) and error_reporting(-1) but still no luck. Any suggestions?

OS: CentOS5.5
PHP: 5.2.6
HTTPD:  Apache/2.2.3
like image 841
Rob Avatar asked Feb 05 '26 16:02

Rob


1 Answers

The following testscript also won't generate any error messages/logs.

<?php
header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error');
echo 'Something went gaga';
?>

However the access_log will show the "500" response code (assuming apache's default access_log settings).

Search the code for "HTTP/1.1 500", "500" or "header(" and add:

trigger_error('Peep', E_USER_NOTICE);  // or error_log()

This will generate an entry in the errorlog (with filename and line-numbers)

like image 117
Bob Fanger Avatar answered Feb 08 '26 06:02

Bob Fanger