2013-06-24 52 views
1

由於某些原因,在這個特定的腳本中,這是我在很多其他地方使用的腳本的副本,我沒有收到任何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!

+0

檢查錯誤日誌報告,您的主機控制面板上。 – Naeem

+0

[error \ _reporting(E \ _ALL)可能的重複不會產生錯誤](http://stackoverflow.com/questions/16933606/error-reportinge-all-does-not-produce-error) – deceze

回答

0

你可以嘗試改變這種行從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 
1

應設置error_reportingphp.ini E_ALL還有:當出現解析錯誤(如缺少分號),你的error_reporting(E_ALL)將不會被使用。

0
error_reporting(E_ALL); 
ini_set('display_errors',1); 
ini_set('display_startup_errors',1);