Home >Backend Development >PHP Tutorial >How to Suppress Strict Standards Error Reporting in PHP 5?

How to Suppress Strict Standards Error Reporting in PHP 5?

Linda Hamilton
Linda HamiltonOriginal
2024-12-14 00:43:10298browse

How to Suppress Strict Standards Error Reporting in PHP 5?

Disabling Strict Standards Error Reporting in PHP 5

Question:

How can I disable the strict standards error reporting in my PHP 5 script?

Answer:

Depending on your specific requirements, you can either disable error reporting entirely or prevent the user from seeing the errors while still logging them. For the latter approach, you can use the following code:

This code will suppress the display of errors, but it will still log them to your standard system log or to a custom location specified by the error_log directive.

Note:

It is generally advisable to log errors, even on a production site. This allows you to monitor errors and resolve issues before they impact the user experience.

The above is the detailed content of How to Suppress Strict Standards Error Reporting in PHP 5?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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