2009-04-28 64 views
-1

我在Ubuntu 9.04(桌面版)上運行LAMP服務器。我對Ubuntu很新,所以我通過Synaptic Packet Manager做了大部分工作。 apt-get install php5
我的錯誤報告被設置爲:error_reporting = E_ALL & ~E_NOTICE爲什麼Xdebug爲包含的文件拋出錯誤,不需要

我安裝的Xdebug和插在我的php.ini文件中的下列通過我然後取出PHP5常見和剛剛安裝PHP5。

zend_extension=/usr/lib/php5/20060613/xdebug.so 

[debug] 
; Remote settings 
xdebug.remote_autostart=off 
xdebug.remote_enable=on 
xdebug.remote_handler=dbgp 
xdebug.remote_mode=req 
xdebug.remote_host=localhost 
xdebug.remote_port=9000 

; General 
xdebug.auto_trace=off 
xdebug.collect_includes=on 
xdebug.collect_params=off 
xdebug.collect_return=on 
xdebug.default_enable=on 
xdebug.extended_info=1 
xdebug.manual_url=http://www.php.net 
xdebug.show_local_vars=0 
xdebug.show_mem_delta=0 
xdebug.max_nesting_level=100 
;xdebug.idekey= 

; Trace options 
xdebug.trace_format=0 
xdebug.trace_output_dir=/tmp 
xdebug.trace_options=0 
xdebug.trace_output_name=crc32 

; Profiling 
xdebug.profiler_append=0 
xdebug.profiler_enable=0 
xdebug.profiler_enable_trigger=0 
xdebug.profiler_output_dir=/tmp 
xdebug.profiler_output_name=crc32 

現在對於某個項目,我的代碼在我的網頁下面一行:

include_once(something.php); 

現在,something.php不excist。因爲它包含在內而不是必需的,所以我期望看到沒有錯誤,但XDebug讓我成爲錯誤報告。有人知道如何提供幫助嗎?

+0

你確定錯誤不是由於你傳遞一個字符串而沒有引號引起的嗎?我不記得錯誤是什麼'水平',但它可能是一個警告... – Narcissus 2009-04-28 20:39:53

回答

1

呃,這不是Xdebug的變化。你也會用普通的PHP獲得警告。

德里克

+0

是的,但看看我的error_reporting。我已經設置好了,所以不應該顯示警告。 – KdgDev 2009-04-29 10:13:34

0

它應該拋出警告,而require_once會拋出致命錯誤。

您可以通過執行解決此破解:

​​

然而,這是一種不好的做法。

另一種方法是明確檢查文件是否存在,但除非您提取所有包含路徑並檢查每個文件是否存在,否則這將不起作用。

+0

哦,該文件不excot,我知道這一事實。事情是,我得到一個警告顯示,即使我的php.ini文件的錯誤報告設置爲不顯示通知......或者我忘記了什麼? – KdgDev 2009-04-29 10:13:01

-1

我想開箱的XDebug的會告訴你比PHP將更多的錯誤,但是這只是我作爲superstitous。

有時只有在滿月出現時纔會出現錯誤。

相關問題