您好,登錄后才能下訂單哦!
這篇文章將為大家詳細(xì)講解有關(guān)php如何忽略所有錯(cuò)誤,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
本教程操作環(huán)境:windows7系統(tǒng)、PHP7.1版、DELL G3電腦
在php中,我們可以使用錯(cuò)誤控制運(yùn)算符@
或error_reporting()函數(shù)屏蔽單行或者單個(gè)文件,但要如何屏蔽所有錯(cuò)誤呢?下面給大家介紹一下。
php忽略所有錯(cuò)誤的方法
1、進(jìn)入PHP安裝目錄,找到并打開 php.ini 配置文件
2、搜索 display_errors
3、然后將 display_errors 的值設(shè)置為 Off 即可關(guān)閉所有的 PHP 錯(cuò)誤報(bào)告。
如下所示:
; 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
關(guān)于“php如何忽略所有錯(cuò)誤”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。