/    Sign up×
Community /Pin to ProfileBookmark

Unable to turn off notice errors in php 5.3.2

Hi everyone,

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
[/CODE]

…I’ve tried setting everything (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
[/CODE]

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.

Can someone help? Is this a bug in PHP 5.3.2 or something I am doing wrong?

Thank you very much for your time!

P. S. Also, how can I get PHP 5.3.2 to support the .php3 extension?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 23.2010 — Are you sure it's notice-level warnings that are the issue and not strict-level?
<i>
</i>error_reporting = E_ALL &amp; ~E_NOTICE &amp; ~E_STRICT
Copy linkTweet thisAlerts:
@MindzaiApr 23.2010 — P. S. Also, how can I get PHP 5.3.2 to support the .php3 extension?[/QUOTE]

PHP doesn't care about extensions, it's apache you need to configure, specficly the AddHandler directive.

AddHandler application/x-httpd-php .php .php4 .php3

You're really still using PHP3 though?

Also the best way to get rid of those notice errors - fix them!
Copy linkTweet thisAlerts:
@knkkauthorApr 25.2010 — Okay, 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).

As for the php3 extension, it was to be set in the /etc/httpd/conf.d/php.conf file:
[CODE]AddHandler php5-script .php .php3
AddType text/html .php[/CODE]


Thank you, Mindzai and NogDog, for your suggestions!
×

Success!

Help @knkk spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...