php怎么忽略所有错误

青灯夜游
Freigeben: 2023-03-13 08:40:02
Original
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
Nach dem Login kopieren

推荐学习:《PHP视频教程

以上是php怎么忽略所有错误的详细内容。更多信息请关注PHP中文网其他相关文章!

Verwandte Etiketten:
php
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!