PHP不显示错误消息 [英] PHP does not display error messages
本文介绍了PHP不显示错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么这是吗?
如何配置PHP显示错误?
解决方案
p>要在脚本级别打开错误,请包含在脚本的顶部:
ini_set('display_errors',1 );
error_reporting(〜0);
或者,如果它不是生产站点,只是一个开发/测试网站,您可以打开php.ini中的错误报告。搜索这些设置:
error_reporting = E_ALL
; error_reporting = E_ERROR
display_errors = On
; display_errors = Off
I installed XAMPP 1.7.4 (with PHP 5.3.5), the problem is PHP does not display any error messages. E.g. if I connect to MYSQL with mysql_connect()
without parameters, PHP will not complain about the required fields.
Why is this?
How can I configure PHP to display errors?
解决方案
To turn on errors at the script level, include at the top of your script:
ini_set('display_errors', 1);
error_reporting(~0);
Alternatively, if it is not a production site and simply a development / testing site, you can turn on error reporting in php.ini. Search it for these settings:
error_reporting = E_ALL
;error_reporting = E_ERROR
display_errors = On
;display_errors = Off
这篇关于PHP不显示错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文