如果關閉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的檔案。