Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

error_reporting(0);

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  Webmaster: Website template for review  
Author Message
Karl Groves

External


Since: May 30, 2006
Posts: 452



(Msg. 1) Posted: Thu Nov 02, 2006 1:02 pm
Post subject: error_reporting(0);
Archived from groups: alt>www>webmaster (more info?)

This seems like a really stupid question.
If I use error_reporting(0); somewhere in a script, it is automatically
restored to defaul (as defined in php.ini) after that particular script,
right? In other words, error handling will be handled the SAME everywhere
else but where this is set.

TIA

--
Karl Groves
www.karlcore.com

 >> Stay informed about: error_reporting(0); 
Back to top
Login to vote
Karl Groves

External


Since: May 30, 2006
Posts: 452



(Msg. 2) Posted: Fri Nov 03, 2006 6:57 am
Post subject: Re: error_reporting(0); [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Toby Inkster <usenet200610.RemoveThis@tobyinkster.co.uk> wrote in
news:du9r14-u1k.ln1@ophelia.g5n.co.uk:

> Karl Groves wrote:
>
>> If I use error_reporting(0); somewhere in a script, it is
>> automatically restored to defaul (as defined in php.ini) after that
>> particular script, right?
>
> Yep -- it only applies until the end of that particular script.
>
> If you want to turn off error reporting more globally, there are
> several php.ini settings for this. The equivalent php.ini setting to
> the error_reporting() function is the error_reporting setting, but my
> personal favourite is the display_errors setting. This prevents errors
> from being displayed to the browser, but still allows them to be
> logged to your web server error log. (Error messages can occasionally
> reveal security issues. Preventing them from being displayed to the
> browser is security through obscurity; but better than nothing.)
>

Thanks for the response. In this instance, I have a rather predictable
error in an OO XML parser and don't have the time (at the moment) to do
anything more glamorous to handle the error. This is a perfect short-term
fix.

--
Karl Groves
www.karlcore.com

 >> Stay informed about: error_reporting(0); 
Back to top
Login to vote
Toby Inkster

External


Since: Oct 03, 2006
Posts: 11



(Msg. 3) Posted: Fri Nov 03, 2006 8:07 am
Post subject: Re: error_reporting(0); [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Karl Groves wrote:

> If I use error_reporting(0); somewhere in a script, it is automatically
> restored to defaul (as defined in php.ini) after that particular script,
> right?

Yep -- it only applies until the end of that particular script.

If you want to turn off error reporting more globally, there are several
php.ini settings for this. The equivalent php.ini setting to the
error_reporting() function is the error_reporting setting, but my personal
favourite is the display_errors setting. This prevents errors from being
displayed to the browser, but still allows them to be logged to your web
server error log. (Error messages can occasionally reveal security issues.
Preventing them from being displayed to the browser is security through
obscurity; but better than nothing.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
 >> Stay informed about: error_reporting(0); 
Back to top
Login to vote
Toby Inkster

External


Since: Oct 03, 2006
Posts: 11



(Msg. 4) Posted: Sun Nov 05, 2006 2:35 pm
Post subject: Re: error_reporting(0); [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Karl Groves wrote:

> Thanks for the response. In this instance, I have a rather predictable
> error in an OO XML parser and don't have the time (at the moment) to do
> anything more glamorous to handle the error. This is a perfect short-term
> fix.

Do you know about the @-syntax to suppress errors? You can prefix any
built-in function's name with an @-sign to suppress error messages. e.g.

$r = @mail($to, $subject, $body, $headers);

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
 >> Stay informed about: error_reporting(0); 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]