homepage Welcome to WebmasterWorld Guest from 54.243.12.156
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Fatal Error Handling, Logging, Security
rudyten




msg:3617917
 9:45 am on Apr 3, 2008 (gmt 0)

in PHP I under stand warning and notices. They end up in log file. FATAL ERRORS....confuse me a bit.

A FATAL ERROR will stop execution on the spot. Something like a missing file in a Require(donotexist.php) or a call to an undefined Function.

Where do this get logged to? Do they? There a nice way to handle this? I see that FATAL ERRORS give away too much information on the screen.

Thanks

 

coopster




msg:3618143
 3:01 pm on Apr 3, 2008 (gmt 0)

error_reporting [php.net] will get you started off in the right direction. Read that page as well as the linked pages regarding the other directives in PHP for handling errors. The biggest questions to answer are "What errors should I be reporting?" and "What method should I use to report them?"

More often than not you will want to report all your errors as this will help you determine where you have issues. How you report them is where the difference comes into play. In your development environment, you may want to log the errors, or you may want to display them in your browser, or both! Both is sometimes a good thing as you may have markup on your page that covers up the error being displayed on the screen. Whatever you decide, be sure to be monitoring errors in your development environment.

Now, on your production box you will want to be sure that you are not displaying errors in the browser! You will log them but it is not wise, nor a good user experience, if you are dumping errors to the browser. Where do they get logged? There is a directive on the page mentioned that explains your options.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved