I am developing a PHP application that uses HTTP response codes for communication as well as the response body. So this is a typical script in PHP code:
try { doSomething(); } catch (Exception $e) { header('HTTP/1.1 500 Internal Server Error'); }
... and typical client code looks like this:
switch(responseCode) { case 200 :
This is cool if all errors are well caught in the PHP code.
Problem. If for some reason a fuzzy error or an elusive error, such as syntax errors , occurs in php code, Apache will send 200 OK. But I will not talk about the 500 Internal Server Error. Maybe for .htaccess or so.
hek2mgl
source share