Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #42749 : error_reporting() does not have any affect (sometimes)
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 9th August 04:38
External User
 
Posts: 1
Default #42749 : error_reporting() does not have any affect (sometimes)



ID: 42749
Updated by: jani@php.net
-Summary: error_reporting() SOMETIMES does not have any affect
Reported By: gabe at mudbugmedia dot com
-Status: Open
+Status: Feedback
-Bug Type: Output Control
+Bug Type: *General Issues
Operating System: Linux proto 2.6.20-hardened-r5
PHP Version: 5CVS-2007-09-24 (snap)
New Comment:

Is it just error_reporting ini option you get this problem with?
It is a bit hard to debug, the ini system being what it is..

Do you use php_admin_* flags anywhere in your httpd.conf (or included
parts of it) ??


Previous Comments:
------------------------------------------------------------------------

[2007-09-24 21:02:55] gabe at mudbugmedia dot com

In the comments of the other bug, this is mentioned:

changed anymore by the @ operator

If I add something like:
@include 'doesnotexist';

at the end of the test file, no warning will be issued even when the
problem behavior is occurring. Usage of the '@' symbol for error
suppression is completely unaffected by this bug.

------------------------------------------------------------------------

[2007-09-24 20:56:17] gabe at mudbugmedia dot com

I extended my reproduction code to check ini_set(), which suffers the
same behavior.

Code:
<?php
var_dump(error_reporting());

var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE));
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice
var_dump(error_reporting());

var_dump(ini_set('error_reporting', E_ALL ^ E_NOTICE ^ E_USER_NOTICE ^

E_USER_WARNING));
var_dump(error_reporting());
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice var_dump(error_reporting());
?>


Output:
int(6143) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 5

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 6
int(6143) bool(false) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 11

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 12
int(6143)

------------------------------------------------------------------------

[2007-09-24 20:54:00] gabe at mudbugmedia dot com

I don't think this is a threading problem, as I'm running Apache 2.2.6

under `prefork` mpm, and when I compiled (via gentoo USE flags -- not
sure what the 'thread' use flag corresponds to in the ./configure),
threads were disabled. Also, the last comment on #41561 states that
threads weren't involved and that it was patched in the CVS last week,

and I've been experiencing this behavior on today's CVS snap.

This is my configure statement:

'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu' '--
mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info' '--
sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--
with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-
php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active'
'--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar'
'--with-curl' '--without-curlwrappers' '--disable-dbase' '--disable-
exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--
disable-ftp' '--with-gettext' '--without-gmp' '--disable-hash' '--
without-iconv' '--disable-ipv6' '--disable-json' '--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql'

'--without-mssql' '--without-ncurses' '--with-openssl' '--with-
openssl-dir=/usr' '--disable-pcntl' '--disable-pdo' '--without-pgsql'
'--without-pspell' '--without-recode' '--disable-reflection' '--
disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap'

'--disable-sockets' '--disable-spl' '--without-sybase' '--without-
sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm'

'--without-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-
xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--without-xsl' '-
-disable-zip' '--with-zlib' '--disable-debug' '--without-cdb' '--
without-db4' '--without-flatfile' '--without-gdbm' '--without-inifile'

'--without-qdbm' '--without-freetype-dir' '--without-t1lib' '--
disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--
without-xpm-dir' '--with-gd' '--with-mysql=/usr' '--with-mysql-
sock=/var/run/mysqld/mysqld.sock' '--without-mysqli' '--with-readline'

'--without-libedit' '--without-mm' '--without-sqlite' '--with-pic'

------------------------------------------------------------------------

[2007-09-24 20:18:06] hoffie at gentoo dot org

Might be related to bug 41561 (and related commits) when building with
threads (I guess this is the case here).

------------------------------------------------------------------------

[2007-09-24 20:04:39] gabe at mudbugmedia dot com

Description:
------------
Periodically PHP stops respecting calls to error_reporting() to alter
the current error level away from the system default specified in
php.ini. All calls to error_reporting() for the current connection
will not update the actual level. This behavior will occur with only
*some* of the connections, but not all of them. Reloading the page
(after waiting for the keep alive to time out) will sometimes result
in the expected behavior, and others will result in the erroneous
behavior. Restarting Apache (running 2.2.6 with mod_php) seems to
briefly fix the problem, but it eventually returns.

This behavior also occurs when trying to set the error reporting level

via .htaccess such as:
php_value "E_ALL ^ E_NOTICE"
when this occurs, a phpinfo() call shows that the error reporting
level has defaulted back to the system-wide default (specified in
php.ini) and ignores the php_value statement all together. Again,
this is behavior that only happens *sometimes* and alters between page

reloads.


As a side effect, this causes all supporting libraries that rely on
error suppression, like Smarty, to throw errors.


Reproduce code:
---------------
<?php
var_dump(error_reporting());

var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE));
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice var_dump(error_reporting());
?>

Expected result:
----------------
int(6143)
int(6143)
int(5111)


Actual result: -------------- int(6143) int(6143)
<br />
<b>Notice</b>: This should not be seen in
<b>/home/gabebug/public_html/error_reporting_tests.php</b> on line
<b>5</b><br
/>
<br />
<b>Notice</b>: Undefined variable: a in
<b>/home/gabebug/public_html/error_reporting_tests.php</b> on line
<b>6</b><br
/>

int(6143)


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=42749&edit=1
  Reply With Quote


  sponsored links


2 9th August 04:39
php-bugs
External User
 
Posts: 1
Default #42749 : error_reporting() does not have any affect (sometimes)



ID: 42749
User updated by: gabe at mudbugmedia dot com
Reported By: gabe at mudbugmedia dot com
-Status: Feedback
+Status: Open
Bug Type: *General Issues
Operating System: Linux proto 2.6.20-hardened-r5
PHP Version: 5CVS-2007-09-24 (snap)
New Comment:

I have some vhosts that have the following within the <VirtualHost>
block:
php_admin_value error_reporting "E_ALL ^ E_NOTICE"

However, this problem is occurring on a vhost that does not use any
php_admin_values, either globally or in the <VirtualHost> block.

I have not had troubles overriding any of the other .ini values that I

know of. I have a few sites that have the following .htaccess:
php_flag short_open_tag on
php_flag register_globals on
php_value error_reporting "E_ALL ^ E_NOTICE"

During page loads when the error_reporting doesn't get properly


same problem. A good portion of my sites also change the include_path
via ini_set(), and I haven't had a single issue with any of those. It

appears that this is specific to the error_reporting ini value and
isn't affecting any of the other ini values.

It should be noted that sites that use a php_admin_value
error_reporting in a <VirtualHost> block have been reported (yet?) to
have any issues with setting a new local value.


Previous Comments:
------------------------------------------------------------------------

[2007-09-25 09:20:53] jani@php.net

Is it just error_reporting ini option you get this problem with?
It is a bit hard to debug, the ini system being what it is..

Do you use php_admin_* flags anywhere in your httpd.conf (or included
parts of it) ??

------------------------------------------------------------------------

[2007-09-24 21:02:55] gabe at mudbugmedia dot com

In the comments of the other bug, this is mentioned:

be
changed anymore by the @ operator

If I add something like:
@include 'doesnotexist';

at the end of the test file, no warning will be issued even when the
problem behavior is occurring. Usage of the '@' symbol for error
suppression is completely unaffected by this bug.

------------------------------------------------------------------------

[2007-09-24 20:56:17] gabe at mudbugmedia dot com

I extended my reproduction code to check ini_set(), which suffers the
same behavior.

Code:
<?php
var_dump(error_reporting());

var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE));
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice
var_dump(error_reporting());

var_dump(ini_set('error_reporting', E_ALL ^ E_NOTICE ^ E_USER_NOTICE ^

E_USER_WARNING));
var_dump(error_reporting());
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice var_dump(error_reporting());
?>


Output:
int(6143) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 5

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 6
int(6143) bool(false) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 11

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 12
int(6143)

------------------------------------------------------------------------

[2007-09-24 20:54:00] gabe at mudbugmedia dot com

I don't think this is a threading problem, as I'm running Apache 2.2.6

under `prefork` mpm, and when I compiled (via gentoo USE flags -- not
sure what the 'thread' use flag corresponds to in the ./configure),
threads were disabled. Also, the last comment on #41561 states that
threads weren't involved and that it was patched in the CVS last week,

and I've been experiencing this behavior on today's CVS snap.

This is my configure statement:

'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu' '--
mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info' '--
sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--
with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-
php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active'
'--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar'
'--with-curl' '--without-curlwrappers' '--disable-dbase' '--disable-
exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--
disable-ftp' '--with-gettext' '--without-gmp' '--disable-hash' '--
without-iconv' '--disable-ipv6' '--disable-json' '--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql'

'--without-mssql' '--without-ncurses' '--with-openssl' '--with-
openssl-dir=/usr' '--disable-pcntl' '--disable-pdo' '--without-pgsql'
'--without-pspell' '--without-recode' '--disable-reflection' '--
disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap'

'--disable-sockets' '--disable-spl' '--without-sybase' '--without-
sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm'

'--without-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-
xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--without-xsl' '-
-disable-zip' '--with-zlib' '--disable-debug' '--without-cdb' '--
without-db4' '--without-flatfile' '--without-gdbm' '--without-inifile'

'--without-qdbm' '--without-freetype-dir' '--without-t1lib' '--
disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--
without-xpm-dir' '--with-gd' '--with-mysql=/usr' '--with-mysql-
sock=/var/run/mysqld/mysqld.sock' '--without-mysqli' '--with-readline'

'--without-libedit' '--without-mm' '--without-sqlite' '--with-pic'

------------------------------------------------------------------------

[2007-09-24 20:18:06] hoffie at gentoo dot org

Might be related to bug 41561 (and related commits) when building with
threads (I guess this is the case here).

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42749

--
Edit this bug report at http://bugs.php.net/?id=42749&edit=1
  Reply With Quote
3 9th August 07:50
php-bugs
External User
 
Posts: 1
Default #42749 : error_reporting() does not have any affect (sometimes)


ID: 42749
User updated by: gabe at mudbugmedia dot com
Reported By: gabe at mudbugmedia dot com
Status: Open
Bug Type: *General Issues
Operating System: Linux proto 2.6.20-hardened-r5
PHP Version: 5CVS-2007-09-24 (snap)
New Comment:

I've been running a httperf on a sample script testing when setting
error_reporting in a <VirtualHost> block via php_admin_value vs.
php_value and watching the error log.

php_admin_value does NOT have problems setting the level
php_value DOES have problems setting the level


Previous Comments:
------------------------------------------------------------------------

[2007-09-25 14:01:03] gabe at mudbugmedia dot com

I have some vhosts that have the following within the <VirtualHost>
block:
php_admin_value error_reporting "E_ALL ^ E_NOTICE"

However, this problem is occurring on a vhost that does not use any
php_admin_values, either globally or in the <VirtualHost> block.

I have not had troubles overriding any of the other .ini values that I

know of. I have a few sites that have the following .htaccess:
php_flag short_open_tag on
php_flag register_globals on
php_value error_reporting "E_ALL ^ E_NOTICE"

During page loads when the error_reporting doesn't get properly


same problem. A good portion of my sites also change the include_path
via ini_set(), and I haven't had a single issue with any of those. It

appears that this is specific to the error_reporting ini value and
isn't affecting any of the other ini values.

It should be noted that sites that use a php_admin_value
error_reporting in a <VirtualHost> block have been reported (yet?) to
have any issues with setting a new local value.

------------------------------------------------------------------------

[2007-09-25 09:20:53] jani@php.net

Is it just error_reporting ini option you get this problem with?
It is a bit hard to debug, the ini system being what it is..

Do you use php_admin_* flags anywhere in your httpd.conf (or included
parts of it) ??

------------------------------------------------------------------------

[2007-09-24 21:02:55] gabe at mudbugmedia dot com

In the comments of the other bug, this is mentioned:

be
changed anymore by the @ operator

If I add something like:
@include 'doesnotexist';

at the end of the test file, no warning will be issued even when the
problem behavior is occurring. Usage of the '@' symbol for error
suppression is completely unaffected by this bug.

------------------------------------------------------------------------

[2007-09-24 20:56:17] gabe at mudbugmedia dot com

I extended my reproduction code to check ini_set(), which suffers the
same behavior.

Code:
<?php
var_dump(error_reporting());

var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE));
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice
var_dump(error_reporting());

var_dump(ini_set('error_reporting', E_ALL ^ E_NOTICE ^ E_USER_NOTICE ^

E_USER_WARNING));
var_dump(error_reporting());
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice var_dump(error_reporting());
?>


Output:
int(6143) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 5

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 6
int(6143) bool(false) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 11

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 12
int(6143)

------------------------------------------------------------------------

[2007-09-24 20:54:00] gabe at mudbugmedia dot com

I don't think this is a threading problem, as I'm running Apache 2.2.6

under `prefork` mpm, and when I compiled (via gentoo USE flags -- not
sure what the 'thread' use flag corresponds to in the ./configure),
threads were disabled. Also, the last comment on #41561 states that
threads weren't involved and that it was patched in the CVS last week,

and I've been experiencing this behavior on today's CVS snap.

This is my configure statement:

'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu' '--
mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info' '--
sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--
with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-
php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active'
'--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar'
'--with-curl' '--without-curlwrappers' '--disable-dbase' '--disable-
exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--
disable-ftp' '--with-gettext' '--without-gmp' '--disable-hash' '--
without-iconv' '--disable-ipv6' '--disable-json' '--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql'

'--without-mssql' '--without-ncurses' '--with-openssl' '--with-
openssl-dir=/usr' '--disable-pcntl' '--disable-pdo' '--without-pgsql'
'--without-pspell' '--without-recode' '--disable-reflection' '--
disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap'

'--disable-sockets' '--disable-spl' '--without-sybase' '--without-
sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm'

'--without-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-
xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--without-xsl' '-
-disable-zip' '--with-zlib' '--disable-debug' '--without-cdb' '--
without-db4' '--without-flatfile' '--without-gdbm' '--without-inifile'

'--without-qdbm' '--without-freetype-dir' '--without-t1lib' '--
disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--
without-xpm-dir' '--with-gd' '--with-mysql=/usr' '--with-mysql-
sock=/var/run/mysqld/mysqld.sock' '--without-mysqli' '--with-readline'

'--without-libedit' '--without-mm' '--without-sqlite' '--with-pic'

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42749

--
Edit this bug report at http://bugs.php.net/?id=42749&edit=1
  Reply With Quote
4 9th August 19:15
External User
 
Posts: 1
Default #42749 : error_reporting() does not have any affect (sometimes)


ID: 42749
Updated by: jani@php.net
Reported By: gabe at mudbugmedia dot com
-Status: Open
+Status: Feedback
Bug Type: *General Issues
Operating System: Linux proto 2.6.20-hardened-r5
PHP Version: 5CVS-2007-09-24 (snap)
New Comment:

What MPM is used in Apache? Note: php_admin_* sets the ini option not
to be modifiable by .htaccess or in scripts using ini_set().
Can you try and create a small test environment with this information?
We need sample config to be able to reproduce this ourselves.
Apparently it's some .htaccess file and/or script changing
error_reporting() using either ini_set() or error_reporting() for it.
Also using @ affects it..


Previous Comments:
------------------------------------------------------------------------

[2007-09-25 19:50:32] gabe at mudbugmedia dot com

I've been running a httperf on a sample script testing when setting
error_reporting in a <VirtualHost> block via php_admin_value vs.
php_value and watching the error log.

php_admin_value does NOT have problems setting the level
php_value DOES have problems setting the level

------------------------------------------------------------------------

[2007-09-25 14:01:03] gabe at mudbugmedia dot com

I have some vhosts that have the following within the <VirtualHost>
block:
php_admin_value error_reporting "E_ALL ^ E_NOTICE"

However, this problem is occurring on a vhost that does not use any
php_admin_values, either globally or in the <VirtualHost> block.

I have not had troubles overriding any of the other .ini values that I

know of. I have a few sites that have the following .htaccess:
php_flag short_open_tag on
php_flag register_globals on
php_value error_reporting "E_ALL ^ E_NOTICE"

During page loads when the error_reporting doesn't get properly


same problem. A good portion of my sites also change the include_path
via ini_set(), and I haven't had a single issue with any of those. It

appears that this is specific to the error_reporting ini value and
isn't affecting any of the other ini values.

It should be noted that sites that use a php_admin_value
error_reporting in a <VirtualHost> block have been reported (yet?) to
have any issues with setting a new local value.

------------------------------------------------------------------------

[2007-09-25 09:20:53] jani@php.net

Is it just error_reporting ini option you get this problem with?
It is a bit hard to debug, the ini system being what it is..

Do you use php_admin_* flags anywhere in your httpd.conf (or included
parts of it) ??

------------------------------------------------------------------------

[2007-09-24 21:02:55] gabe at mudbugmedia dot com

In the comments of the other bug, this is mentioned:

be
changed anymore by the @ operator

If I add something like:
@include 'doesnotexist';

at the end of the test file, no warning will be issued even when the
problem behavior is occurring. Usage of the '@' symbol for error
suppression is completely unaffected by this bug.

------------------------------------------------------------------------

[2007-09-24 20:56:17] gabe at mudbugmedia dot com

I extended my reproduction code to check ini_set(), which suffers the
same behavior.

Code:
<?php
var_dump(error_reporting());

var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE));
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice
var_dump(error_reporting());

var_dump(ini_set('error_reporting', E_ALL ^ E_NOTICE ^ E_USER_NOTICE ^

E_USER_WARNING));
var_dump(error_reporting());
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice var_dump(error_reporting());
?>


Output:
int(6143) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 5

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 6
int(6143) bool(false) int(6143)
Notice: This should not be seen in
/home/gabebug/public_html/error_reporting_tests.php on line 11

Notice: Undefined variable: a in
/home/gabebug/public_html/error_reporting_tests.php on line 12
int(6143)

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42749

--
Edit this bug report at http://bugs.php.net/?id=42749&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666