-1

我在 Ubuntu 9.04(桌面版)上运行 LAMP 服务器。我对 Ubuntu 很陌生,所以我通过 Synaptic 数据包管理器完成了大部分工作。然后我删除了 php5-common 并通过以下方式安装了 php5:apt-get install php5
我的错误报告设置为:error_reporting = E_ALL & ~E_NOTICE

我安装了 Xdebug 并在我的 php.ini 文件中插入了以下内容。

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 不存在。因为它已包含在内且不是必需的,所以我希望不会看到任何错误,但 XDebug 会为我提供错误报告。有人知道如何提供帮助吗?

4

3 回答 3

1

呃,这不是 Xdebug 改变的东西。您也会收到使用纯 PHP 的警告。

德里克

于 2009-04-29T08:59:09.273 回答
0

它应该抛出一个警告,而 require_once 抛出一个致命的。

您可以通过以下方式解决此问题:

@include_once('something.php');

但是,这是一种不好的做法。

另一种方法是显式检查文件是否存在,但除非您提取所有包含路径并检查文件是否存在于每个路径中,否则这将不起作用。

于 2009-04-28T19:41:29.300 回答
-1

我认为开箱即用的 xdebug 会比 php 向您显示更多错误,但这只是我迷信。

有时它也只会在满月时抛出错误。

于 2009-05-01T22:37:38.820 回答