• 技术文章 >PHP >PHP教程

    php.ini中屏蔽所有错误的方法

    小妮浅浅小妮浅浅2021-09-11 16:39:44原创21193

    1、打开“php.ini”配置文件,在其中搜索“display_errors”项。

    2、将“display_errors”项的值设置为“Off”即可关闭所有的PHP错误报告,进而屏蔽所有错误。

    实例

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    ; 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.ini中屏蔽所有错误的方法,希望对大家有所帮助。更多php学习指路:php教程

    专题推荐:phpini
    上一篇:php显示和实际时间不同的解决 下一篇:php中如何设计队列

    相关文章推荐

    • php curl返回错误码60的解决办法• php数字去掉逗号的方法• php将正数转为负数的方法• php使用header()禁止缓存的方法• php判断数组元素不为空格的方法• php去除小数点后多余0的方法• php显示和实际时间不同的解决

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网