没有得到PHP错误?
问题描述:
由于某些原因,在这个特定的脚本中,这是我在很多其他地方使用的脚本的副本,我没有收到任何PHP错误。它只是一个空白页面,而今天早上我花了很长时间才找到一个缺失的分号。为什么没有出现错误?没有得到PHP错误?
我的php.ini该子域:
session_start();
error_reporting(E_ALL);
ini_set('display_errors', '1');
的子域设置为运行PHP作为Apache Module
那就是:
display_errors = On
short_open_tag = On
memory_limit = 32M
date.timezone = Europe/Paris
在页面顶部的代码与我使用的每个其他域相同。
所以我不知道为什么我没有得到错误显示。谁能告诉我?
编辑: 这是解决了,因为我产生误差均在网页,我已经得到了线路上: 的error_reporting(E_ALL); ini_set('display_errors','1'); 写的。当我把错误放到一个单独的页面并包含它时,我可以看到错误。
我想这就是为什么他们使用bootstrapping!
答
你可以尝试改变这种行从PHP获取更多信息:
; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. But, it's strongly recommended that you
; leave this setting off on production servers.
display_startup_errors = On
; When PHP displays or logs an error, it has the capability of formatting the
; error message as HTML for easier reading. This directive controls whether
; the error message is formatted as HTML or not.
; Note: This directive is hardcoded to Off for the CLI SAPI
html_errors = On
答
应设置error_reporting
在php.ini
E_ALL还有:当出现解析错误(如缺少分号),你的error_reporting(E_ALL)
将不会被使用。
答
error_reporting(E_ALL);
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
检查错误日志报告,您的主机控制面板上。 – Naeem
[error \ _reporting(E \ _ALL)可能的重复不会产生错误](http://stackoverflow.com/questions/16933606/error-reportinge-all-does-not-produce-error) – deceze