php5 on LAMP does not show all errors with E_ALL

浪子不回头ぞ 提交于 2019-12-24 11:50:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!