error reporting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Furman

    error reporting

    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

    #2
    Re: error reporting

    "Paul Furman" <paul-@-edgehill.net> wrote in message
    news:4fHRf.5996 4$dW3.2817@news svr21.news.prod igy.com...
    <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.


    Comment

    • Chung Leong

      #3
      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.

      Comment

      • Paul Furman

        #4
        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?

        Comment

        • R. Rajesh Jeba Anbiah

          #5
          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/

          Comment

          • Paul Furman

            #6
            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.

            Comment

            Working...