[FX.php List] PHP Error Reporting...One more time
Leo R. Lundgren
leo at finalresort.org
Wed Sep 3 16:23:35 MDT 2008
Steve, That's looks like a good guide.
Please note that the real fatal errors (that happens during parsing
of the PHP source code, for example) cannot be trapped/handled by a
custom error handler. Not sure if that's what you meant, just
clarifying. So yes, Jonathan, you still need something else than a
custom error handler, if you need something that will alert you of
the fatal errors (before the client does :>)
I'd Google or search SourceForge/Freshmeat for some script/app that
will do it for you. It's fairly easy to script using the shell, but
someone must have done that already, I'd guess.
3 sep 2008 kl. 23.05 skrev Steve Winter:
> Hi Jonathan,
>
> I think you'll find that's not actually the case... any sort of error,
> including seemingly fatal (script) errors can be trapped by a
> custom error
> handler (as Leo describes) and then process additional PHP code
> which will
> send you an email with details of the error which occurred.
>
> There's a good introduction to php error handlers at
> http://articles.techrepublic.com.com/5100-10878_11-6113787.html
>
> Alternatively let me know and I can send you an example that I've
> developed
> which can, if FM is still responding log errors, as well as sending
> email
> etc...
>
> Cheers
> Steve
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jonathan
> Schwartz
> Sent: Wednesday, 3 September 2008 9:37 p.m.
> To: FX.php Discussion List
> Subject: Re: [FX.php List] PHP Error Reporting...One more time
>
> Well said, Leo.
>
> I am just now realizing that there are two levels of PHP errors...in
> addition to all the other levels of errors that we need to deal with.
> Unfortunately in my case, it is the show-stopping errors (syntax)
> that I am looking at. In this case, PHP has been stopped in its
> tracks and is unable to alert anyone/anything.
>
> However, the web server's heart is still beating and it knows that
> PHP barfed. There is even an entry in the web server log. I just
> need that to turn into an email.
>
> Should I be looking at a notification tool for OS X Server/Apache?
>
> And...ggt...I honestly have NO IDEA what you are talking about. Sorry
>
> Jonathan
>
>
> At 10:08 PM +0200 9/3/08, Leo R. Lundgren wrote:
>> Interesting/good question :-)
>>
>> I think it's fair to say that there are two major types of errors in
>> PHP; The ones that raise warnings, notices and so on, but still let
>> your application keep running even though the expected results of
>> whatever it's doing may not be very,, expected. Then there are the
>> kind of errors that stop the application from running, such as
>> syntax errrors. These latter ones will hopefully not occur too often
>> unless you're really doing it wrong or don't check your edits at all.
>>
>> However, for the first type of errors, you could define your own
>> error handler in PHP, that will be called whenever an error that
>> you've configured it to handle occurs. For example, if there is an
>> error that you deem not to be that serious, you could have the
>> handler e-mail you the error notifications, and for serious errors
>> you could handle it in a more graceful way than you would without
>> global error handler. See
>> http://se.php.net/manual/en/function.set-error-handler.php.
>>
>> For the second type of errors there's not that much to do from
>> inside PHP since your application may not start at all in such
>> cases. These will have to be taken care of using your skillz ;-)
>>
>>
>> 3 sep 2008 kl. 21.48 skrev Jonathan Schwartz:
>>
>>> Like I said, the application here is making quick edits on working
>>> scripts. One out-of-place character takes down the entire solution,
>>> until discovered and repaired.
>>>
>>> Happens more often than I'd like to admit.
>>>
>>> Will look into ggt's response....
>>>
>>>
>>> J
>>>
>>>
>>>
>>>
>>> At 2:39 PM -0500 9/3/08, Bob Patin wrote:
>>>> I have a script for sending emails on FM errors, but I too would
>>>> love to know about any PHP errors. However, once a page is
>>>> properly written, it's not going to randomly generate PHP errors,
>>>> so I'm wondering what the usefulness of this would be other than
>>>> in the initial programming stage...
>>>>
>>>> From the peanut gallery,
>>>>
>>>> Bob Patin
>>>> Longterm Solutions
>>>> bob at longtermsolutions.com
>>>> 615-333-6858
>>>> http://www.longtermsolutions.com
>>>> iChat: bobpatin
>>>> AIM: longterm1954
>>>> FileMaker 9 Certified Developer
>>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>>> --------------------------
>>>> FileMaker hosting and consulting for all versions of FileMaker
>>>> PHP * Full email services * Free DNS hosting * Colocation *
>>>> Consulting
>>>>
>>>> On Sep 3, 2008, at 2:16 PM, Jonathan Schwartz wrote:
>>>>
>>>>> Hi folks,
>>>>>
>>>>> Occasionally, php syntax errors can result after performing
>>>>> on-the-fly script edits for clients, and there just isn't time to
>>>>> perform testing. Call me human. ;-)
>>>>>
>>>>> However, it is often the client that informs me of the error.
>>>>> Hmmm...
>>>>>
>>>>> To resolve, I'd like to receive email notification for php errors
>>>>> on any page ( not FMP errors) and have a shot at finding the
>>>>> error first.
>>>>>
>>>>> What mechanism can do that?
>>>>>
>>>>>
>>>>> Thx
>>>>>
>>>>> J
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Jonathan Schwartz
>>>>> Exit 445 Group
>>>>> jonathan at exit445.com
>>>>> http://www.exit445.com
>>>>> 415-370-5011
>>>>> _______________________________________________
>>>>> FX.php_List mailing list
>>>>> FX.php_List at mail.iviking.org
>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>> --
>>> Jonathan Schwartz
>>> Exit 445 Group
>>> jonathan at exit445.com
>>> http://www.exit445.com
>>> 415-370-5011
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>> -|
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> --
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-370-5011
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.6.15/1648 - Release Date:
> 2/09/2008
> 5:29 p.m.
>
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.6.15/1648 - Release Date:
> 2/09/2008
> 5:29 p.m.
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-|
More information about the FX.php_List
mailing list