PHP错误报告按需(PHP Error reporting on demand)
在PHP中,如何使它在使用error_reporting()函数时才显示错误。 目前,IIS PHP应用程序设置为“生产计算机”。 如果我将其更改为开发机器,它将打印出所有错误,即使没有error_reporting()。
In PHP how do you make it so that it will only display errors when using the error_reporting() function. Currently the IIS PHP application is set to 'Production machine'. If I change it to Development machine it will print out all errors even without error_reporting().
最满意答案
您可以通过应用程序设置error_reporting并覆盖php.ini设置。
无论如何,你永远不应该把它关掉。
相反,在php.ini或代码中将display_errors更改为Off :
ini_set('display_errors', 0);I got the behavior I wanted using:
error_reporting(E_ALL); ini_set('display_errors', 1);更多推荐
发布评论