"John Coggeshall" <[EMAIL PROTECTED]> wrote... : > What about require'd files? > > Back on the note that I was discussing (the E_PARSE with a user > error-handler), Perhaps the issue can be slightly skirted without having > to code a whole lot... Specifically, what about simply re-directing the > user to another URL in the event of a fatal PHP error (as specified by a > directive)... Ie. > > On_fatal_error=http://somewhere.com/error.php > > Where on a E_PARSE, or something similar, PHP basically does a C-version > of: > > <?php header("Location: http://somewhere.com/error.php?errno=4"); ?> > > This way, users who don't care can still re-direct a browser to a nice > and pretty "sorry, the server is really screwed" HTML page... Or, if > they'd like, they can simply take that error number and create a > error-handler in PHP without us having to bother with the problems > surrounding a bad parser-state... > > John
I must say that I like this idea. User should be alble to specify the error page in php.ini for different error types and instructing the script to move onto a custom page, leaving the execution of a "bad code" alone. There would be several reasons why to treat errors gracefuly, even the E_PARSE ones: First reason is to be able to update the current pages in the production server with less risks. When you edit a file on a production site, you might create an E_PARSE error and correct it few seconds later. Not a big deal, but users currently online will be simply told - "be back later - server experiences some trouble". Throwing errors on screen includes the full path and can sometimes be a theoretical security risk. Another reason I find for this is, when you do dynamic things like grabbing PHP code from other sources passing it through eval(). That can be out of your control and as such requires a more friendly error treatment. All that provided that an error log is being generated with " on line xxx in file xxx" but the page is the URL you specify in php.ini. -- Maxim Maletsky [EMAIL PROTECTED] -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php