php如何忽略所有错误

发布时间:2021-10-15 10:59:57 作者:小新
来源:亿速云 阅读:146

这篇文章将为大家详细讲解有关php如何忽略所有错误,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

本教程操作环境: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如何忽略所有错误”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. Python忽略warning警告错误
  2. php如何忽略错误

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

php

上一篇:css如何设置边框颜色

下一篇:php如何将值强制类型转换为float

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》