3 ms·
Wow, you're right. I sort of assumed it would pick up on an error like this.
by KevBurnsJr 16y ago
Wow, you're right. I sort of assumed it would pick up on an error like this.
- nbpoole 16y agoIt physically can't: without the opening PHP tag the parser just thinks the entire file is HTML to be outputted to the browser, which is still a valid PHP file. ;)
- KevBurnsJr 16y agoI suppose you could also write a quick bash script to ensure the first 5 characters of any .class.php file matches "<?php", but it wouldn't be very generally applicable and wouldn't fix a problem like this for a file named config.php
- KevBurnsJr 16y agoI suppose you could add some code to Varnish to tell it to squelch any and all 500 responses.
- KevBurnsJr 16y agoLooks like PHP returns a 200 when it encounters a fatal error. Edit: Here's a way to force 500 for fatal errors in PHP http://blog.kevburnsjr.com/php-fatal-error-500 http://blog.kevburnsjr.com/php-fatal-error-500