Home  >  Article  >  php教程  >  PHP 开启报错机制

PHP 开启报错机制

WBOY
WBOYOriginal
2016-06-06 19:49:241233browse

屏蔽PHP错误提示 方法一: 在有可能出错的函数前加@,然后ordie("") 如: @mysql_connect(...)ordie("DatabaseConnectError") 方法二: 编辑php.ini,查找"display_errors=",将=后面的值改为"off。(就是把它前面的;去掉,值设成ON) 方法三: 在php脚本前

 

屏蔽PHP错误提示

方法一:在有可能出错的函数前加@,然后or die("") 
如: 
@mysql_connect(...) or die("Database Connect Error")

方法二:编辑php.ini ,查找"display_errors =" ,将“=”后面的值改为"off。(就是把它前面的;去掉,值设成ON)

方法三:在php脚本前加error_reporting(0),屏蔽所有错误提示。
其中,error_reporting 配置错误信息回报的等级。

语法:int error_reporting(int [level]);
返回值:整数
函数种类:PHP 系统功能

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn