View Issue Details

IDProjectCategoryView StatusLast Update
0002070XdebugStep Debuggingpublic2022-05-13 16:33
ReporterGrowiel Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version3.1.2 
Summary0002070: xdebug.start_with_request=trigger not working, starts all the time
Description

Hello,

XDEBUG seems to be ignoring xdebug.start_with_request=trigger and treat it the same as xdebug.start_with_request=yes.

My debugging sessions start all the time, even when I don't set any trigger.

Here's my config:

xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.trigger_value=PHPIDE

But when i do anything at all, XDEBUG tries to start a debug session, for example:

rasmus@e72a5b142652:/var/www/symfony$ php -r "echo 'Hello'.PHP_EOL;"
Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: 172.20.189.112:9001 (through xdebug.client_host/xdebug.client_port) :-(
Hello
TagsNo tags attached.
Operating SystemWSL
PHP Version7.4.20-7.4.29

Relationships

has duplicate 0002059 resolvedderick XDebug always activated without trigger when idekey and XDEBUG_CONFIG is set at the same time 

Activities

Growiel

2022-03-03 11:19

reporter  

image.png (26,770 bytes)   
image.png (26,770 bytes)   
image-2.png (16,887 bytes)   
image-2.png (16,887 bytes)   

derick

2022-03-07 15:49

administrator   ~0006231

Can you add -dxdebug.log=/tmp/xdebug.log and -dxdebug.log_level=10, and then attach what shows in the /tmp/xdebug.log file?

cheers,
Derick

Growiel

2022-03-08 07:12

reporter   ~0006236

Here you go:

rasmus@e42e6073ad65:/var/www/symfony$ php -dxdebug.log=/tmp/xdebug.log -dxdebug.log_level=10 -r "echo 'Hello'.PHP_EOL;"
Hello
rasmus@e42e6073ad65:/var/www/symfony$ tail /tmp/xdebug.log
[20] Log opened at 2022-03-08 07:10:23.141014
[20] [Step Debug] DEBUG: Found 'XDEBUG_CONFIG' ENV variable
[20] [Step Debug] INFO: Connecting to configured address/port: 172.20.176.236:9001.
[20] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: 172.20.176.236:9001 (through xdebug.client_host/xdebug.client_port) :-(
[20] Log closed at 2022-03-08 07:10:23.342171

rasmus@e42e6073ad65:/var/www/symfony$ echo $XDEBUG_CONFIG
client_host=172.20.176.236

For good measure I added the content of the XDEBUG_CONFIG variable.

image-3.png (45,456 bytes)   
image-3.png (45,456 bytes)   

derick

2022-03-09 16:10

administrator   ~0006238

Hi,

this is by design, as you can see in this test.

If the XDEBUG_CONFIG environment variable is set, then this also acts like a trigger. This is due to legacy reasons, which I did not want to break with Xdebug 3.

In order to avoid this, you must not set XDEBUG_CONFIG, and instead move the configurations that you have made in there to your xdebug.ini (or php.ini) file.

I will eventually remove this XDEBUG_CONFIG trigger in a future version of Xdebug.

cheers,
Derick

Growiel

2022-03-09 20:46

reporter   ~0006240

Ok thansk.

Could at least the documentation be updated? I spent a way too big amount of time on this because I trusted the documentation.

There's already a note about "legacy" here: https://xdebug.org/docs/all_settings#start_with_request why not add the fact that simply setting XDEBUG_CONFIG to any value at all act as a trigger?

On a personal note I feel like going from Xdebug 2 to 3, you'd expect breaking changes and it's fine to break this one.

Thanks.

derick

2022-03-11 18:03

administrator   ~0006243

I've documented this now, and also created a ticket to track the removal of these legacy triggers (there is another one, from 0002068): https://bugs.xdebug.org/2073

Issue History

Date Modified Username Field Change
2022-03-03 11:19 Growiel New Issue
2022-03-03 11:19 Growiel File Added: image.png
2022-03-03 11:19 Growiel File Added: image-2.png
2022-03-07 15:49 derick Assigned To => derick
2022-03-07 15:49 derick Status new => feedback
2022-03-07 15:49 derick Note Added: 0006231
2022-03-08 07:12 Growiel Note Added: 0006236
2022-03-08 07:12 Growiel File Added: image-3.png
2022-03-08 07:12 Growiel Status feedback => assigned
2022-03-09 16:10 derick Status assigned => resolved
2022-03-09 16:10 derick Resolution open => no change required
2022-03-09 16:10 derick Note Added: 0006238
2022-03-09 20:46 Growiel Note Added: 0006240
2022-03-11 17:57 derick Relationship added has duplicate 0002059
2022-03-11 18:03 derick Note Added: 0006243