SV: [PHP4BETA] error in error_reporting() !!
| From: | Johan Ekenberg | Date: | Sat, 26 Feb 2000 00:36:27 +0000 |
| Subject: | SV: [PHP4BETA] error in error_reporting() !! | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11017@lists.php.net to get a copy of this message | ||
> > Using PHP as an Apache module, it seems that
> > Apache retains the value set by error_reporting()
> > between requests. This means that whatever
> > error reporting level is set within a script,
> > it's inherited by all subsequent php scripts
> > until changed by another error_reporting() call.
>
> I think php3 behaves like this as well.
> I always thought this was normal.
>
> I've had to monitor the default settings on some hosts to make
> sure I was setting it back to the right level, a pain.
True pain. On a multiuser host (a webhosting environment
for instance), *every* script would have to include an
explicit error_reporting() call. Otherwise the user can
not be sure what error-reporting level will apply at runtime.
That is, IMHO, outrageous.
Perhaps this is an implementational problem, running
as an Apache module? A developer will have to answer that,
I don't know enough about these things.
> Alternatively, being able to do error_reporting(default)
> would be handy.
It would, but this alone wouldn't solve the problem.
Every script would still have to call error_reporting()
to be sure of the environment in which it's running.
Why even include "error_reporting" in php.ini in the
first place? Sure, it will work as a default, but as
soon as _one_ script on the server starts calling
error_reporting() without explicitly setting it back
to the default before it exits, the "default" from
php.ini can no longer be trusted by any script on the
server.
/Johan Ekenberg