问题
this kinda weird, i have been working on LAMP and suddenly realized that my php.ini files placed in "/etc/php5/cli" and "/etc/php/apache2" has Display errors as On and with error reporting set to E_ALL.
As per my knowledge this simple code below should give an error
<?
echo "hello";
header('location:http://google.com');
?>
The error that i expect to come should be
hello Warning: Cannot modify header information - headers already sent by (output started at writecodeonline.com/php:1) on line 3
but it does not shows the error rather open google.com
回答1:
You have probably enabled the output buffering.
Try set output_buffering = Off
来源:https://stackoverflow.com/questions/12856981/php5-on-lamp-does-not-show-all-errors-with-e-all