Php 为什么Xdebug会对';s包括在内,不是必需的

Php 为什么Xdebug会对';s包括在内,不是必需的,php,ubuntu,include,xdebug,ubuntu-9.04,Php,Ubuntu,Include,Xdebug,Ubuntu 9.04,我在Ubuntu 9.04(桌面版)上运行LAMP服务器。我是Ubuntu的新手,所以我大部分都是通过Synaptic数据包管理器完成的。然后,我删除了php5 common,并通过以下方式安装了php5:apt get install php5 我的错误报告设置为:error\u reporting=E\u ALL&~E\u NOTICE 我安装了Xdebug并在php.ini文件中插入了以下内容 zend_extension=/usr/lib/php5/20060613/xdebug.so

我在Ubuntu 9.04(桌面版)上运行LAMP服务器。我是Ubuntu的新手,所以我大部分都是通过Synaptic数据包管理器完成的。然后,我删除了php5 common,并通过以下方式安装了php5:
apt get install php5

我的错误报告设置为:
error\u reporting=E\u ALL&~E\u 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会给我一个错误报告。有人知道如何帮助吗?

它应该发出警告,而require\u一旦发出致命警告

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

@include_once('something.php');
然而,这是一种糟糕的做法


另一种方法是显式检查文件是否存在,但除非提取所有包含路径并检查每个路径中是否存在该文件,否则将无法工作。

嗯,这不是Xdebug更改的内容。使用普通PHP也会收到警告


Derick

我认为开箱即用的xdebug会比php显示更多的错误,但这只是我的超级能力


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

您确定错误不是因为您传递了一个没有引号的字符串造成的吗?我不记得那个错误是什么“级别”,但它可能是一个警告…哦,文件没有激活,我知道这是事实。问题是,尽管我的php.ini文件的错误报告设置为“不显示通知”,我还是会看到一条警告。。。还是我忘了什么?是的,但看看我的错误报告。我把它设置为不显示警告。除非我读错了,否则你不能显示通知,而不是警告。因此,警告是有效的。