LAMP上的php5不会显示E_ALL的所有错误 [英] php5 on LAMP does not show all errors with E_ALL
问题描述
这有点奇怪,我一直在研究LAMP,突然意识到我的php.ini文件 放置在 "/etc/php5/cli"和"/etc/php/apache2"将显示错误"设置为开",并且错误报告设置为E_ALL.
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');
?>
我希望会出现的错误
您好警告:无法修改标头信息-标头已发送 通过(第3行的输出开始于writecodeonline.com/php:1)
hello Warning: Cannot modify header information - headers already sent by (output started at writecodeonline.com/php:1) on line 3
但不显示错误,而是打开google.com
but it does not shows the error rather open google.com
推荐答案
您可能已启用输出缓冲.
You have probably enabled the output buffering.
尝试设置output_buffering = Off
这篇关于LAMP上的php5不会显示E_ALL的所有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!