问题描述
所以我有xampp,这东西根本不会报告任何东西...我什至强加了一个错误,它什么也没做...
So I have xampp and the thing won't report anything at all... I even forced an error and it didn't do anything...
我使用了
error_reporting(-1);
ini_set( 'display_errors', 1 );
根据本文档
还 error_reporting(E_ALL);
也不做任何事情...
also error_reporting(E_ALL);
doesn't do anything either...
推荐答案
可能您没有收到任何简单错误,例如:
Probably you're not getting any 'simple' errors like:
Parse error: syntax error, unexpected T_VARIABLE in .../.../index.php on line 6
#or
Warning: include(whateveryouwantedto.include): failed to open str(...)
但是您会得到类似的东西:
But you do get things like:
Fatal error: Call to undefined method stdClass::Crap() in .../.../index.php on line 6
根据我的想法,这是因为如果您不禁用登录PHP配置,则简单错误将无处发送。换句话说:PHP通过不显示任何错误来帮助您,因为您定义了 log_errors = On
和/或 error_log ='php_errors.log '
,它会记录所有真实错误,但您只是不要将其归为真实类别。
According to my thinking hat, this is because if you don't disable logging in your PHP configuration the 'simple' errors will be sent 'nowhere'. In other words: PHP is 'helping' you by not showing any errors because you either defined log_errors = On
and/or error_log = 'php_errors.log'
and it's logging all 'real' errors but your's just don't cut it to the 'real' category.
如果这没有帮助,那么思考的帽子会说:它无法记住,但是我确信天堂/地狱知道它在PHP中或Apache配置。
If this doesn't help, the thinking hat says: "It can't f* remember, but I sure as heaven/hell know it is somewhere in the PHP or Apache config."
当然希望我的思想帮到您。
Sure hope my thinking hat helped you out.
编辑:
解决此问题的方法可能是找到并打开php.ini,全选,删除/退格,保存(但保持打开状态)(或将副本保存在某处)。然后重新启动Apache。看看有什么区别。如果是这样,则php配置位于其他位置。恢复php文件,然后从根目录开始搜索您的计算机或服务器,寻找另一个php.ini。
Tackling this problem might be to find and open php.ini, select all, delete/backspace, save (but keep open) (or save a copy somewhere). Then restart Apache. See if there's any difference. If so, the php configuration is somewhere else. Restore the php file and search your computer or server from the root up for another php.ini.
我想您也应该确保: b
Also I think you should make sure :
log_errors = Off
error_log = "./"
display_errors = On
error_reporting = E_ALL
或者在PHP中:
error_reporting(E_ALL & E_STRICT);
ini_set('display_errors', '1');
ini_set('log_errors', '0');
ini_set('error_log', './');
这篇关于打开xampp的错误报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!