Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddev xdebug toggle and ddev xdebug status hang if xdebug is enabled and an IDE is listening for xdebug #6191

Open
rfay opened this issue May 15, 2024 · 5 comments

Comments

@rfay
Copy link
Member

rfay commented May 15, 2024

Expected Behavior

ddev xdebug status and ddev xdebug toggle should "just work" no matter what the situation.

Actual Behavior

If an IDE is listening on port 9003, and xdebug is enabled, both of these hang.

Steps To Reproduce

  1. Start PhpStorm and make it listen.
  2. ddev xdebug on
  3. ddev xdebug status or ddev xdebug toggle will hang

Anything else?

More detail and ideas in

We can probably safely use php --version | grep -i xdebug for this more safely and prevent this problem.

It would also be trivial to change to XDEBUG_MODE=off php -r 'echo ini_get("xdebug.mode");', which would work for Xdebug 3, it might not be right for Xdebug 2.

@tyler36
Copy link
Collaborator

tyler36 commented May 16, 2024

Unable to replicate on VSCode. Perhaps we can replace "IDE" with "PHPstorm" in the title and description?

Test

  1. Open DDEV project in VScode
  2. Start Debug listener in VScode
  3. Toggle xdebug in DDEV:
$ ddev xdebug toggle
Building project images... 
...
Enabled xdebug
  1. VSCode continues to function
  • Can open new files
  • Update files
  • navigate around menu
  • enter commands in terminal

DDEV: 1.23.0
VSCode: 1.89.1
VSCode xdebug.php-debug 1.34.0

@rfay
Copy link
Member Author

rfay commented May 16, 2024

The problem happens when you:

  • Enable xdebug
  • THEN ddev xdebug toggle.

@tyler36
Copy link
Collaborator

tyler36 commented May 16, 2024

OK,

Test

  1. Create break point
  2. Turn on listener in Vscode
  3. Turn on xdebug
$ ddev xdebug
Enabled xdebug
  1. Confirm breakpoint is it. Continue through to allow page to load.
  2. Toggle xdebug
$ ddev xdebug toggle
Disabled xdebug
  1. No problems.
  2. Turn on xdebug
$ ddev xdebug
Enabled xdebug
  1. Confirm breakpoint is it.
  2. While on breakpoint, toggle xdebug
$ ddev xdebug toggle
Disabled xdebug
  1. Vscode removes debugging info. Site displays as "502 Bad Gateway", but displays correctly on refresh. Things seem to work as expected.

@rfay
Copy link
Member Author

rfay commented May 16, 2024

Thanks for the careful testing. I doubt that this is different between PhpStorm and vscode, but it may very well be different between macOS (where I tested) and Win/WSL2.

In my testing I didn't exercise the website or breakpoints at all. I just ddev xdebug and then ddev xdebug status or ddev xdebug toggle

@tyler36
Copy link
Collaborator

tyler36 commented May 16, 2024

Just tried on Gitpod to remove the OS variable.
Running ddev xdebug and then ddev xdebug status then ddev xdebug toggle doesn't seem cause any hangs in the Gitpod VScode or it's terminal.

Can anyone replicate it on Gitpod or Codespaces?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants