PHP error suppression is being ignored
Asked Answered
P

1

5

My current php.ini file is set to report all errors other than deprecation and strict standards as follows:

error_reporting = E_ALL & ~E_STRICT & ~E_DEPRECATED

The reason for using this setting is that we urgently need to perform a PHP upgrade on the linux server hosting our websites; the problem there being that deprecated functions and strict standards recommendations will very quickly fill up error log files for over 170 websites. The errors are mostly due to small things like functions not being declared as static, etc. Eventually we will get through all the sites and fix those problems, however in the meantime we need to suppress the errors.

The problem I'm having on a local test environment (running the version of PHP we are looking to upgrade to - 5.4.3) is that the errors still display with the following printed before:

SCREAM: Error suppression ignored for

Can anyone give me some insight into why the error suppression is being ignored and how to properly suppress the errors?

Thanks in advance.

Putative answered 4/3, 2013 at 13:54 Comment(2)
Perhaps a stupid question, but have you restarted the Apache?Nebiim
Not a stupid question, surprising how often its overlooked. But yes I am restarting all WAMP services.Putative
T
8

It seems that you are using the scream extension. From the manual:

The scream extension gives the possibility to disable the silencing error control operator so all errors are being reported. This feature is controlled by an ini setting.

Scream is an extension for debugging that aims to display as many error messages as possible. This is done by ignoring the @ operator and always having the highest error_reporating level available. (regardless of your error_reporting setting). So you will have to deactivate the extension in your php.ini:

scream.enabled = off

BTW: I would not update a server having 170 websites with code errors. It's a ticking bomb now. It would be better to migrate them site by site to the new PHP version. Maybe having two servers parallel during the migration process.

Tritium answered 4/3, 2013 at 16:15 Comment(3)
Adding scream.enabled = Off to the php.ini file doesn't stop the error suppression from being ignored. At the moment adding that line does nothing. I understand this is a pretty messy method to do things, but its only temporary. I've had no luck so far with installing another PHP instance as CGI so I'm looking for other options. Any ideas?Putative
I was able to get the second instance of PHP working on our server, thanks for the suggestion.Putative
@WilliamStewart Sorry that I've not recognized you first comment. Without having a look at actual settings of your servers I can just point out that the error_reporting level can be set per script. Maybe one or more of your 170 sites doing this? However, regular PHP error messages should not have a 'Scream: ' prefix. About the second comment: I think that's a good idea!Tritium

© 2022 - 2024 — McMap. All rights reserved.