View Issue Details

IDProjectCategoryView StatusLast Update
0001958XdebugStep Debuggingpublic2021-03-20 21:14
Reportermarbul Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Summary0001958: XDEBUG_SESSION does not work in CLI
Description

Have set debug.mode=debug.
xdebug.start_with_request=default (did not change that, just saying)
Documentation says that with this config the step debugging will start if "trigger" exists. So I add a trigger XDEBUG_SESSION=1 and xdebug does not start a debugging session:
docker exec -it -e XDEBUG_SESSION=1 <container_id> bin/console cache:clear

Additional information:

  • xdebug version: 3.0.0
  • works with HTTP requests containing a trigger (XDEBUG_SESSION=1)
  • works when xdebug.start_with_request=yes
  • does not work with xdebug.start_with_request=trigger
  • does not work when XDEBUG_SESSION=1
  • log file (/tmp/xdebug.log) is not created (PHP FPM runs as root user, child processes run as www-data user, /tmp is owned by root. I created /tmp/xdebug.log and chown'ed www-data but still no logs)
  • used PHP Storm build in client but also dbgpClient to verify and the same issues occures as described above

I'm still trying to find out what's going on so will update this issue if I find the problem source before someone answers.

TagsNo tags attached.
Operating System
PHP Version7.4.10-7.4.19

Activities

marbul

2021-03-20 19:27

reporter   ~0005805

How can i edit issue? I can't see any button like Edit or something.

derick

2021-03-20 19:32

administrator   ~0005806

Just add updates in comments. I don't think Mantis allows you to edit issues.

And to ask for more info: what does the output of xdebug_info() ; tell you if you debug a script with that in it?

marbul

2021-03-20 19:32

reporter   ~0005807

As I can't see any edit button the I would like to correct this line:
- does not work when XDEBUG_SESSION=1
I meant: does not work when XDEBUG_SESSION=1 is set not via -e option to docker exec but in docker-compose file under environment key. I don't think is makes any difference but just want to mention this as I've tried even this for certainty.

marbul

2021-03-20 19:37

reporter   ~0005808

xdebug_info() output from script code

marbul

2021-03-20 19:56

reporter   ~0005809

next info:
I tried the same with some reproducer app from some project I contributed to and it works. Xdebug 3.0.3 and PHP 8.0.2. xdebug_info() in attachment (mode set via XDEBUG_MODE env var).

marbul

2021-03-20 20:02

reporter   ~0005810

I found this in change log: https://bugs.xdebug.org/view.php?id=1921
I will try to upgrade xdebug version in my image to 3.0.3 and see it it helps.

marbul

2021-03-20 20:34

reporter   ~0005811

It worked. Issue can be closed. Thank you.

derick

2021-03-20 21:14

administrator   ~0005812

Cheers, will do. Glad it works in Xdebug 3.0.3!