Home  >  Article  >  Backend Development  >  How to ignore all errors in php

How to ignore all errors in php

青灯夜游
青灯夜游Original
2021-10-12 14:28:592380browse

The operating environment of this tutorial: Windows 7 system, PHP version 7.1, DELL G3 computer

In PHP, we can use the error control operator @ or the error_reporting() function to block a single line Or a single file, but how to mask all errors? Let me introduce it to you below.

php method to ignore all errors

1. Enter the PHP installation directory, find and open the php.ini configuration file

2. Search for display_errors

3, and then set the value of display_errors to Off to turn off all PHP error reports.

is as follows:

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; For production environments, we recommend logging errors rather than
; sending them to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = Off

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to ignore all errors in php. 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