ini_set ("display_errors","On"); 和 error_reporting (E_ALL);

简介: ini_set ("display_errors","On"); 和 error_reporting (E_ALL);

在用 php 做网站开发的时候 , 为防止用户看到错误信息,而出现的不友好界面。故一般性会在 php.ini 里设置:

display_errors = Off;

不过在开发的时候,我们有时候需要打开错误信息。这时候,可以在 php 文件里设置:

  ini_set("display_errors","On");

   error_reporting(E_ALL);

不过有时候我们及时这样设置了  还是无法显示 php 里的语法错误。

这是由于 php 文件的语法错误导致该文件根本没有被执行,所以当然不会显示错误信息

解决方法:

假设这个 php 里有语法错误

你可以新建一个 test.php

然后在该 php 里如下编辑:

ini_set("display_errors","On");

error_reporting(E_ALL);

include ("目标文件");

这样,当你在运行 test.php 的时候  程序就会报其中的错误语法.

error_reporting (“E_ALL”) 和 ini_set (“display_errors”, “on”) 的区别?

后者的权限大于前者,后者是 OFF 的话,前者就算是 E-ALL 也没用。

转自 :http://blog.sina.com.cn/s/blog_63940ce201015t1n.html

相关文章
|
4月前
|
JavaScript
Error loading saved preferences: ~/.vuerc may be corrupted or have syntax errors. Please fix/delete
Error loading saved preferences: ~/.vuerc may be corrupted or have syntax errors. Please fix/delete
|
6月前
|
安全 Java 应用服务中间件
A configuration error occurred during startup.Please verify the preference field with the prompt: To
A configuration error occurred during startup.Please verify the preference field with the prompt: To
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
122 0
|
JavaScript
TypeError: Cannot read properties of null (reading 'level')
# 一、分析问题 1、一个下拉框组件的更新由另一个下拉框组件控制被动更新列表,子级下拉框的值是由父级下拉框的值调用接口获取,每次父级下拉框值的改变都会改变子级下拉框的数据源也就是会改变子级下拉框的options,切换后之前的父级节点找不到就会报了这个错,父级节点不改变(即不切换)的话不会报错 # 二、解决方案 ## 1、vue页面的html层 ```html <div> <el-row :gutter="15"> <el-col :span="4"> <div">父级下拉框:</div> <el-select clearable v-model="parentId" @c
170 0
成功解决:ERROR StatusLogger No log4j2 configuration file found.
成功解决:ERROR StatusLogger No log4j2 configuration file found.
|
开发工具
WARNING: library configuration mismatch
WARNING: library configuration mismatch
303 0
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179)
365 0
|
Java Android开发
is not allowed for source level below 1.7 的解决办法
is not allowed for source level below 1.7 的解决办法
185 0
|
网络协议 关系型数据库 Linux
onfigure: error: no acceptable C compiler found in $PATH See `config.log' for more details 问题解决
onfigure: error: no acceptable C compiler found in $PATH See `config.log' for more details 问题解决
182 0
|
应用服务中间件 Android开发
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
136 0
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name: