I have a shutdown function:
function shutdownFunction(){
if (connection_aborted()) {
header("Status: 409");
} elseif (connection_status() == CONNECTION_TIMEOUT) {
header("Status: 410");
} else {
//normal completion actions
}
}
When the connection times out or is aborted, i would like to return a custom header status to the calling application. Although it does execute whatever code is inside the second IF block, it still returns a 500 Internal Server Error, not the custom 409 or 410.
Any Ideas?
Internal Server Error is a suspension of processing PHP code, so you can not handle it with “if/else”. Although exception handling with “try/catch” maybe can help.
Add:
in .htaccess you can write this:
For this action you need “AllowOverride FileInfo” in your apache config file.