View Issue Details

IDProjectCategoryView StatusLast Update
0001953XdebugStep Debuggingpublic2021-03-04 09:30
Reporternaitsirch Assigned Toderick  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionno change required 
Summary0001953: Getting "Xdebug: [Step Debug] Time-out connecting to debugging client" event without started session
Description

I have the issue that every execution of PHP in CLI produces the output "debug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(", although I have unsetted the XDEBUG_SESSION env variable.

$ env | grep XDEBUG
XDEBUG_MODE=debug
XDEBUG_CONFIG=idekey=netbeans-xdebug

$ php -r "var_dump(xdebug_is_debugger_active());"
Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(
bool(false)

As far as I understand XDebug should not start doing anything when no XDEBUG_SESSION env variable exists. Am I missing something or is it a bug?

Additional Information

$ php --version
PHP 7.4.15 (cli) (built: Feb 27 2021 15:45:26) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans

ini settings:

xdebug.mode=debug
xdebug.discover_client_host=true
xdebug.max_nesting_level=400

TagsNo tags attached.
Operating SystemDebian 10.8
PHP Version7.4.10-7.4.19

Activities

derick

2021-03-03 11:51

administrator   ~0005703

Your culprit is this line:

$ env | grep XDEBUG
XDEBUG_CONFIG=idekey=netbeans-xdebug

Xdebug 3's documentation no longer mentions this, but this is a legacy way of starting the step debugger, and something that many IDEs still use internally. I didn't want to break that.

If your IDE key is always the same (and, it really ought to be), then you can set it in php.ini through xdebug.idekey, and then the debugger should not activate.

In a single line (note the -n passed to php to stop the ini file from loading and resetting Xdebug's settings to their defaults):

<pre>
$ XDEBUG_MODE=debug php -n -dzend_extension=xdebug -dxdebug.mode=debug -dxdebug.discover_client_host=true -dxdebug.idekey=netbeans-xdebug -r "var_dump(xdebug_is_debugger_Active());"
</pre>

naitsirch

2021-03-04 09:30

reporter   ~0005706

You are right. Thanks for the hint.

Issue History

Date Modified Username Field Change
2021-03-03 10:29 naitsirch New Issue
2021-03-03 11:51 derick Assigned To => derick
2021-03-03 11:51 derick Status new => resolved
2021-03-03 11:51 derick Resolution open => no change required
2021-03-03 11:51 derick Note Added: 0005703
2021-03-04 09:30 naitsirch Note Added: 0005706