Home > Backend Development > PHP Tutorial > How Can I Suppress Strict Standards Errors in PHP 5 While Still Logging Them?

How Can I Suppress Strict Standards Errors in PHP 5 While Still Logging Them?

DDD
Release: 2024-11-19 19:06:03
Original
412 people have browsed it

How Can I Suppress Strict Standards Errors in PHP 5 While Still Logging Them?

Disabling Strict Standards Error Reporting in PHP 5

To disable strict standards error reporting in PHP 5, modify the start of your script with the appropriate functions. It's recommended to log errors even in production environments for analysis purposes.

// Suppress error display
ini_set('display_errors', '0');

// Report all errors (including strict standards) but do not display them
error_reporting(E_ALL | E_STRICT);
Copy after login

These settings will prevent error messages from being shown to users while still allowing them to be logged to the system log. You can also utilize the error_log directive to specify a specific destination for error logging. By separating error logging from error display, you can retain valuable error information for debugging while providing a clean and user-friendly interface to your end users.

The above is the detailed content of How Can I Suppress Strict Standards Errors in PHP 5 While Still Logging Them?. 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