php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51652 Unable to turn off E_NOTICE errors
Submitted: 2010-04-24 06:50 UTC Modified: 2010-04-25 14:32 UTC
From: knkk at fullhyd dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
19 + 22 = ?
Subscribe to this entry?

 
 [2010-04-24 06:50 UTC] knkk at fullhyd dot com
Description:
------------
I recently migrated to PHP 5.3.2, and realized that I am unable to turn off notice errors in my site now. I went to php.ini, and in these lines:


Code:
; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_NOTICE

...I've tried setting every combination (and I restart apache each time), but I am unable to get rid of notices.

The only way I'm able to get rid of notice errors is by setting :


Code:
display_errors = Off

That is, of course, not something I can do since I need to see errors to fix them, and I would like to see errors on the webpage that I am coding rather than log them somewhere.

I am not using the error_reporting function in my code, so there is no question of over-writing. Plus, I am editing the proper php.ini file.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-25 14:23 UTC] knkk at fullhyd dot com
Correction - there is no bug. My bad.

I figured what was going wrong. I set error_reporting in my code, which was overwriting the php.ini error_reporting.

Now the reason that that same stuff was working until I upgraded to PHP 5.3.2 was this - in my code, I set the error_reporting command:

[CODE]error_reporting(6143);[/CODE]
I should've set it as:
[CODE]error_reporting(E_ALL ^ E_NOTICE);[/CODE]
I'm guessing the meaning of 6143 is different in PHP 5.3.2 compared to in 4.1 (or whatever my earlier version was).
 [2010-04-25 14:32 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-04-25 14:32 UTC] pajoye@php.net
Not a bug > bogus
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Sep 20 18:01:26 2020 UTC