View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001941 | Xdebug | Step Debugging | public | 2021-01-29 15:55 | 2021-03-17 11:13 |
| Reporter | alisqi-jeroen | Assigned To | |||
| Priority | high | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | no change required | ||
| Product Version | 3.0.2 | ||||
| Summary | 0001941: Cannot activate step debugging | ||||
| Description | I've followed the docs for the correct configuration, but step debugging doesn't start, and the log stays empty. $ echo $XDEBUG_SESSION | ||||
| Steps To Reproduce | Start docker container with and copy xdebug.ini: See https://xdebug.org/docs/upgrade_guidexdebug.mode=debug See https://xdebug.org/docs/step_debug#activate_debuggerxdebug.start_with_request=no | ||||
| Tags | No tags attached. | ||||
| Operating System | debian | ||||
| PHP Version | 7.4.5-7.4.9 | ||||
|
|
Forgot to say that neither CLI nor web works. If I set |
|
|
I made small a mistake in the description (and I cannot edit it!). The second shell command has |
|
|
Xdebug's "start_with_request" does not accept the value "1", see the documentation: https://xdebug.org/docs/all_settings#start_with_request — it accepts only "yes", "no", or "trigger". And for XDEBUG_SESSION to work, it needs to be set to "trigger", unless it's set to "yes" in which case Xdebug will always initiate a debugging request. |
|
|
All right, I just tried to add a note with the output of xdebug_info() and got the following error: I'll try again but wanted you know that there's a bug in the bug tracker you might want to report. Inception! |
|
|
Hi derick, Sorry for not replying earlier. Re: XDEBUG_SESSION
The upgrade docs (https://xdebug.org/docs/upgrade_guide#Step-Debugging) state
The Step debugging docs (https://xdebug.org/docs/step_debug#activate_debugger) state
This contradicts your comment, no? |
|
|
Re: xdebug_info();I have the following script: <?php I run it from CLI with The log file is created (confirming write access), but it's empty. I'll append the script's output as a file. |
|
|
If I configure xdebug.ini with |
|
|
Hi derick, Is there anything else I can provide to help diagnose this problem? Maybe a GitHub repo with a Dockerfile and a shell script to run to demonstrate the problem? |
|
|
I don't think there is a bug here. You either set xdebug.start_with_request=yes, OR, you set xdebug.start_with_request=trigger, and use XDEBUG_SESSION=yourname when calling PHP. The output of your xdebug_info.txt in comment 0001941:0005695 has "xdebug.start_with_request => no => no", in which case it certainly won't start. |
|
|
Hi derick, Thanks for your reply. Setting xdebug.start_with_request=trigger works exactly as expected. I agree that there's no bug, but I do really think the docs could be improved. The upgrade guide (https://xdebug.org/docs/upgrade_guide/en) says
The step debugging docs (https://xdebug.org/docs/step_debug#activate_debugger) says
Neither tells / reminds users (explicitly) to set xdebug.start_with_request=trigger. |
|
|
That's correct, because by default you don't need to do that. The first paragraph of "Activating the Debugger" (following your link) says:
xdebug.start_with_request's default value is "default", which for step debugging means the same as "trigger": https://xdebug.org/docs/all_settings#start_with_request Unless you change the value of "xdebug.start_with_request" manually, all you need to do is "xdebug.mode=debug" and "export XDEBUG_SESSION=foo". The documentation is concise and accurate here. |