Errors are not being recorded in error_log

I am trying to track down the reason some of my users are reporting a blank white page while trying to view different links on my website. I recently upgraded to PHP 5.3 and I’m using one php.ini file for all my directories. In my php.ini file I think I have everything turned on correctly. But when I goto a page I know has a parse error, even though I see the error on the screen, it is not logging it in the error_log file on the root of my server. Can someone help me understand why?

; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below. While errors should not be displayed on productions
; servers they should still be monitored and logging is a great way to do that.
; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
; http://php.net/log-errors-max-len
log_errors = 1024

; Log errors to specified file. PHP’s default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
error_log = error_log
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog

Thanks!

What error reporting level have you got set?

http://www.php.net/manual/en/errorfunc.constants.php

The directive regarding the location of the log file for a domain can also be set inside the httpd.conf file (using Apache anyway) which will overrule your php.ini file setting AFAICT.

Meh, just set your log file to /dev/null. It will make things interesting.*

*That was a joke … please do not do that

Just tested this script to ensure my error_log was reporting correctly:



  # set error_log and toggle settings
     ini_set('display_errors',0);
     ini_set('error_reporting(',0);

  # show previous errors in log_file
     $error_log = ini_get('error_log');
     clearstatcache($error_log);
     echo '<pre>';
        echo '<h1>' .$error_log .'</h1>';
        highlight_file($error_log);
     echo '</pre>';

  # force error and stop execution
     require 'this-is-a-test-to-see-if-the-errors-are-being-logged.php' .time();

  echo 'This line should never ever be displayed';