Reputation: 15112
Imagine for a second you have the following php based page served via apache + mod_php :
<?
blahblah!!!_!_!(___);
?>
This is obviously invalid php, and the script would fail.
Is there any way to signal to mod_php / apache / php.ini (?) to issue a 5xx based status code + document body when this happens?
Ideally one that I could edit / create on my own...
Thanks!
Upvotes: 0
Views: 115
Reputation: 71384
Your best bet is to look at defining custom error handlers and a shutdown function in PHP to do this for you.
You would just capture the error, and you could then send custom 5XX error header and whatever additional content (i.e. custom error page) you desire.
The following links in the PHP manual should get you what you need.
register_shutdown_function manual
Upvotes: 1