我运行在Ubuntu 9.04(桌面版)LAMP服务器。我很新的Ubuntu的,所以我通过突触包经理做这个最。然后我删除PHP5常见和刚刚安装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不excist。因为它包含和不要求,我希望看到没有错误,但XDebug的让我的错误报告。有谁知道怎么帮?

有帮助吗?

解决方案

呃,这不是一件Xdebug的变化。你已经得到了与普通的PHP警告也是如此。

德里克

其他提示

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

您可以通过做解决此破解:

@include_once('something.php');

然而,这是一种不好的做法。

另一种方法是显式检查文件是否存在,但这样做不工作,除非你提取所有包括的路径,并检查文件中的每个是否存在。

我觉得开箱的XDebug的会告诉你比PHP将更多的错误,但是这只是我作为superstitous。

有时只有当有一个满月了,也抛出一个错误。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top