NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can I set the response code if a PHP Fatal error occurs?

Daniel Horning dan.horning at planetnoc.com
Tue Feb 17 10:09:25 EST 2009


Wouldn't you just need to do this at the apache level?

 

Something as simple as an "ErrorDocument 200 /path/to/other.notify.script"
in htaccess or in apache conf should allow you to reach this goal

 

--

Dan Horning

 

American Digital Services - Where you are only limited by imagination.

dan.horning at planetnoc.com :: http://www.americandigitalservices.com

1-518-444-0213 x502 . toll free 1-800-863-3854 . fax 1-888-474-6133

15 Third Street, PO Box 746, Troy, NY 12180 (by appointment only)

 

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of lorband at optonline.net
Sent: Tuesday, February 17, 2009 10:06 AM
To: talk at lists.nyphp.org
Subject: [nycphp-talk] Can I set the response code if a PHP Fatal error
occurs?

 

 I am using AJAX to submit a PHP request. If a PHP Fatal error occurs when
running the php program, the http response code is 200 and it appears the
program ran successfully. Is there a way for php to return a 500 http
response code when a fatal error occurs so myjava_script that is processing
the response can alert the user that an error has occurred? Try/catch won't
capture fatal errors for me to set the header. 

Thank you,

Lori

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090217/6198d5ce/attachment.html>


More information about the talk mailing list