My server (Apache2, PHP5) returns a blank page with Header Code 500 whenever it comes across a simple parse error in PHP. For instance:
<?php functiondoesnotexist(); ?>
or
<?php echo 'with2semicolons';; ?>
Does not output one of those orange tables telling me what's wrong, the server simply bails.
I've checked the Apache error logs and it is indeed telling me the error (for instance Undefined function functiondoesnotexist()).
How can I stop this behaviour? My php.ini is (as far as I know) untouched.
You can set these error variables in your php.ini file:
error_reporting = E_ALL | E_STRICT
display_errors = On
And/or override them at the start of your php scripts when needed:
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
Try adding the error reporting and display_errors per ini_set before, e.g.:
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', '1')
?>
...
<?php functiondoesnotexist(); ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With