如果关闭PHP的Notice/Warning这类提示

修改PHP.INI文件的配置即可。

下面是配置文件中的说明,按照对应的说明选择配置组合即可。

------------修改ERROR报错的等级-----------

; Common Values:
;   E_ALL (Show all errors, warnings and notices including coding standards.)
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL

------------配置报错日志文件的名称-----------

; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog

一旦配置了error_log为php_errors.log,那么每个PHP接口一旦出现满足报错等级的信息,就会在PHP接口所在目录生成一个名字为php_errors.log的文件。

猜你喜欢

转载自blog.csdn.net/dodott/article/details/81069844
今日推荐