Disabling PHP Notice Output
Despite disabling display_errors in php.ini, users may encounter ongoing PHP notice messages such as "Constant DIR_FS_CATALOG already defined." This issue persists even after adding display_errors = Off.
To resolve this and suppress notice output, it is suggested to set error reporting level to E_ALL & ~E_NOTICE; using either the error_reporting ini setting or the error_reporting() function.
However, it is important to note that notices, while annoying, can serve a crucial purpose. In this case, the notice indicates an attempt to define a constant twice, which will ultimately fail and prevent the constant from being modified. It is advisable to address the underlying issue rather than simply suppressing the notice.
The above is the detailed content of How to Suppress PHP Notices Despite Disabling `display_errors`?. For more information, please follow other related articles on the PHP Chinese website!