php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9904 error_reporting setting in apache conf not respected in pages
Submitted: 2001-03-21 12:47 UTC Modified: 2001-10-20 21:54 UTC
From: sklar at tvgrid dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.0 Latest CVS (20/03/2001) OS: Linux host 2.2.12-20 #1 Mon Sep
Private report: No CVE-ID: None
 [2001-03-21 12:47 UTC] sklar at tvgrid dot com
The error_reporting setting I put in my apache conf doesn't work in my pages, but if I call error_reporting() with the same value in the page, it works. I am using build php4-200103160645. I am attempting to follow the instructions at http://www.php.net/manual/cs/x49925.php. PHP is configured suchly:
./configure '--with-apache=../apache_1.3.19+mod_ssl'
   '--with-mysql=/usr/local/mysql-3.23.32-pc-linux-gnu-i686' '--with-xml'
   '--enable-track-vars' '--without-ldap' '--without-imap' '--without-gd'

The relevant section of my httpd.conf:

php_value track_vars   1
php_value track_errors 1
php_value display_errors       0
php_value log_errors   1
php_value error_reporting "E_ALL & ~ ( E_NOTICE )"

In a page, <?php echo ini_get('error_reporting');?> reports back 
E_ALL & ~ ( E_NOTICE )
Calling phpinfo() also reports the same Local Value for error_reporting

However, If I have a page that looks like this:

<?php

parse error 

?>

Nothing appears in the error log.

<?php

error_reporting(E_ALL);

parse error

?>

Also puts nothing in the error log, I guess because it hits the parse error before the error_reporting() function call gets executed.

However, a page like this:

<?php

imaginary_function();

?>

puts nothing in the error log, while

<?php

error_reporting(E_ALL & ~ ( E_NOTICE ));
imaginary_function();

?>

correctly puts a message in the error log ("PHP Fatal Error: Call to undefined function: imaginary_function() .....")

My php.ini only has entries for include_path, max_execution_time, and track_errors, nothing about error_reporting.

The same behavior happens if the error_reporting setting in my httpd.conf is just E_ALL.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-20 21:54 UTC] sniper@php.net
RTFM:

http://www.php.net/manual/en/configuration.php

(the error_reporting in apache confs only accepts numbers as value)

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 16:01:27 2020 UTC