Can't get PHP to report errors

Nathan picture Nathan · Aug 31, 2010 · Viewed 14.8k times · Source

I can't see any PHP errors. I have tried every trick I can find to turn error reporting on, but nothing works.

display_errors is on and error_logging is on, but when I view any page with an error, I get a blank page.

/var/log/php.log does not exist.

if I set a local logfile, Nothing gets created.

The file I have been testing with is

<?php
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
ini_set('error_log','script_errors.log');
ini_set('log_errors','On');


$a=

phpinfo();
?>

any other ideas?

Answer

Hans picture Hans · Aug 31, 2010

You probably need to set it in .htaccess, httpd.conf or php.ini (depending on your server or hosting company). You most likely have a parse error, which means your script never gets to the point where it can turn on the error reporting.