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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: knkk at fullhyd dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC