views:

263

answers:

3

I'm running LAMP server on Ubuntu 9.04(Desktop edition). I'm very new to Ubuntu, so I did most of this via the Synaptic Packet Manager. I then removed php5-common and just installed php5 via: apt-get install php5
My error reporting is set to: error_reporting = E_ALL & ~E_NOTICE

I installed Xdebug and inserted the following in my php.ini file.

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

Now for a certain project, I have the following line of code in my pages:

include_once(something.php);

Now, something.php does not excist. Because it's included and not required, I expect to see no errors, yet XDebug makes me an error report. Does anybody know how to help?

A: 

It should throw a warning, whereas require_once throws a fatal.

You can hack around this by doing:

@include_once('something.php');

However, that's kind of bad practice.

The alternative is to explicitly check if the file exists, but that won't work unless you extract all the include paths and check if the file exists in each.

Matt
Oh the file does not excist, I know that for a fact. The thing is, I'm getting a warning shown, even though my php.ini file has the error reporting set to not show notices... Or am I forgetting something?
WebDevHobo
+1  A: 

Uh, this is not something that Xdebug changes. You'd have gotten a warning with plain PHP as well.

Derick

Derick Rethans
Yeah, but look at my error_reporting. I've set it so that warnings shouldn't be shown.
WebDevHobo
Unless I'm reading that wrong, you've got it to not show notices, not warnings. Therefore, the warning is valid.
Narcissus
A: 

I think out of the box xdebug will show you more errors than php would, but that's just me being superstitous.

Sometimes it only throws an error when there's a full moon out, too.

xkcd150