“从技术上讲”,这只是一个PHP警告而不是错误,您不应该在生产服务器上启用警告。您可以禁用PHP记录警告,它仍然会将错误记录到错误日志文件中。
您可以通过在自定义PHP中设置PHP警告来禁用它。服务器上的ini文件(除警告外的所有错误):error_reporting = E_ALL & ~E_WARNING
或者尝试使用PHP进行设置:
error_reporting(E_ALL & ~E_WARNING);
从…起
php.ini
文件:
; 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