Home > Backend Development > PHP Tutorial > How to Suppress PHP Notices Despite Disabling `display_errors`?

How to Suppress PHP Notices Despite Disabling `display_errors`?

DDD
Release: 2024-11-09 00:55:02
Original
507 people have browsed it

How to Suppress PHP Notices Despite Disabling `display_errors`?

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template