Connecting Tech Pros Worldwide Forums | Help | Site Map

error reporting

Paul Furman
Guest
 
Posts: n/a
#1: Mar 14 '06
What is the proper way to turn off error reporting? I'm on a shared
server so...

"Note: Although display_errors may be set at runtime (with ini_set ()),
it won't have any affect if the script has fatal errors. This is because
the desired runtime action does not get executed."

.... has me confused if this will really work. Sorry I'm rusty on this.

"To set at runtime, use the error_reporting(). See also the
display_errors directive."

I don't mind if visitors get some error messages when there is a problem
but when the database goes down for a moment they get the login &
password that failed <grin>.

Rich
Guest
 
Posts: n/a
#2: Mar 15 '06

re: error reporting


"Paul Furman" <paul-@-edgehill.net> wrote in message
news:4fHRf.59964$dW3.2817@newssvr21.news.prodigy.c om...
<snip>

My advice would be to ensure that your script has no errors, period. Don't
disable the error reporting because it's there for a reason ;)

Try and enumerate all possible scenarios that may cause a problem, and
create a workaround/solution for them. Less headaches in the long run, imo.

Rich.


Chung Leong
Guest
 
Posts: n/a
#3: Mar 15 '06

re: error reporting


Paul Furman wrote:[color=blue]
> What is the proper way to turn off error reporting? I'm on a shared
> server so...[/color]

That depends on what you mean by turning off error reporting. Setting
display_errors to 0 means simply that PHP won't display error message.
Depending on the error reporting level, the error could still be
recorded in the error log (if one is set up). Doing a
error_reporting(0) means errors won't get into the error log either.

Another difference is that error_reporting(0) doesn't stop CORE
error/warning messages from displaying. They're very rare though.
[color=blue]
> "Note: Although display_errors may be set at runtime (with ini_set ()),
> it won't have any affect if the script has fatal errors. This is because
> the desired runtime action does not get executed."[/color]

Yeah, the phraseology is kinda weird. What they mean is if you have a
syntax error in your script, then error_reporting(0) never gets called
as the operation has died (and emitted the error message) at the
parsing stage. They don't say that exactly because in PHP 5, some
language errors in some circumstances can cause early termination too.

Paul Furman
Guest
 
Posts: n/a
#4: Mar 22 '06

re: error reporting


Paul Furman wrote:
[color=blue]
> What is the proper way to turn off error reporting? I'm on a shared
> server so...
>
> "Note: Although display_errors may be set at runtime (with ini_set ()),
> it won't have any affect if the script has fatal errors. This is because
> the desired runtime action does not get executed."
>
> ... has me confused if this will really work. Sorry I'm rusty on this.
>
> "To set at runtime, use the error_reporting(). See also the
> display_errors directive."
>
> I don't mind if visitors get some error messages when there is a problem
> but when the database goes down for a moment they get the login &
> password that failed <grin>.[/color]


OK so I just inserted this line:
ini_set (display_errors, 0)

However I still get mySQL syntax errors, the most obvious problem before
was with database connection errors when the database server went down
for maintenance so this concerns me. I'm not sure if that was SQL or PHP
error messages. Can I turn off mySQL errors?
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#5: Mar 23 '06

re: error reporting



Paul Furman wrote:[color=blue]
> Paul Furman wrote:
>[color=green]
> > What is the proper way to turn off error reporting? I'm on a shared
> > server so...[/color][/color]
<snip>[color=blue]
> OK so I just inserted this line:
> ini_set (display_errors, 0)
>
> However I still get mySQL syntax errors, the most obvious problem before
> was with database connection errors when the database server went down
> for maintenance so this concerns me. I'm not sure if that was SQL or PHP
> error messages. Can I turn off mySQL errors?[/color]

What is the error message?

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Paul Furman
Guest
 
Posts: n/a
#6: Apr 6 '06

re: error reporting


R. Rajesh Jeba Anbiah wrote:
[color=blue]
> Paul Furman wrote:
>[color=green]
>>Paul Furman wrote:
>>
>>[color=darkred]
>>>What is the proper way to turn off error reporting? I'm on a shared
>>>server so...[/color][/color]
>
> <snip>
>[color=green]
>>OK so I just inserted this line:
>>ini_set (display_errors, 0)
>>
>>However I still get mySQL syntax errors, the most obvious problem before
>>was with database connection errors when the database server went down
>>for maintenance so this concerns me. I'm not sure if that was SQL or PHP
>>error messages. Can I turn off mySQL errors?[/color]
>
>
> What is the error message?[/color]

Late reply, any SQL problem I think, recently there was a syntax error
due to an unescaped quote, before the database server (separate machine)
was down for a minute & it reported that problem although that might
have been php, not mysql.
Closed Thread