Quote:
Originally Posted by poyzn
|
Yes, I did briefly consider that, but only tried it to see the behavior once you mentioned it. I used this:
PHP Code:
if(file_exists('alpha.php'))
{ include 'alpha.php'; }
else { header('/'); }
- It produces an HTTP 500 when the file doesn't exist (And used with an invalid header call like this, obviously), regardless of whether PHP error reporting is on or not. Again, I find myself confused as to why some errors send HTTP 500 and why some are content with sending a blank page. (This is even more confusing, because I expected a "Headers already sent" at least).
- Doesn't matter to it if the file that exists is producing fatal errors or not, so it's pretty much doing the same as the
if(include 'alpha.php') I was experimenting with. With the exception that it doesn't use the php.ini include path, which is kind of important. (Yeah I could get the path via
ini_get, but so far using
file_exists doesn't seem to solve the problem. It still seems inconsistent or 'hack-ish' getting the error this way, and can't find the status of the file.)
Thanks anyway..