php怎么忽略所有错误

青灯夜游
풀어 주다: 2023-03-13 08:40:02
원래의
2236명이 탐색했습니다.

本教程操作环境:windows7系统、PHP7.1版、DELL G3电脑

在php中,我们可以使用错误控制运算符@或error_reporting()函数屏蔽单行或者单个文件,但要如何屏蔽所有错误呢?下面给大家介绍一下。

php忽略所有错误的方法

1、进入PHP安装目录,找到并打开 php.ini 配置文件

2、搜索 display_errors

3、然后将 display_errors 的值设置为 Off 即可关闭所有的 PHP 错误报告。

如下所示:

; 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
로그인 후 복사

推荐学习:《PHP视频教程

위 내용은 php怎么忽略所有错误의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
php
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!