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學習者快速成長!