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

Make developer experience better for xdebug stepped debugging #176

Open
philipnorton42 opened this issue Jan 30, 2024 · 3 comments
Open

Comments

@philipnorton42
Copy link
Contributor

I feel that we could improve ce-dev significantly by having a better experience when trying to use xdebug.

My experience of xdebug on ce-dev is normally:

  • After getting things setup I'll try to use xdebug to perform stepped debugging to find that it is not setup.
  • I ssh into the container (using ce-dev ssh) and run php --ini to find the xdebug configuration.
  • See that the xdebug configuration file is empty.
  • Run docker network inspect ce_dev to find the gateway of the ce-dev network.
  • Copy and paste some xdebug configuration settings, along with the gateway found in the network readout.
  • Restart the fpm service.

There are probably far better ways of doing this, but if need to run a ce-dev provision step (for whatever reason) then I'll have to go through this process again. Occasionally, the network gateway address will change, which means I need to perform this process a second time.

This normally takes around 10-15 minutes per project, often battling with PHPStorm and the xdebug settings to see what I've missed. It will sometimes require me performing the same action to the cli and fpm xdebug configuration files when I want to use stepped debugging on the cli.

So, what would be good is a way of activating the xdebug stepped debugging using a ce-dev command (or even as part of the provision process) so that it "just works"TM.

It was suggested that we use an internal docker network identifier instead of the network gateway address, but I don't know much about this.

Secondarily to this, we should think about doing the same with the xdebug profiler as that can be invaluable in certain situations.

Happy to test anything out if needed!

@DionisioFG
Copy link
Contributor

I think this ticket should be fixed in https://github.com/codeenigma/ce-provision/tree/2.x/roles/debian/php_xdebug, as part of the role installed xdebug

@pm98zz-c
Copy link

Right, so, just add a look and it probably is because the internal network interface has changed, apparently. It used to be docker.for.mac.localhost but is now host.docker.internal
I think this is setup somewhere in ce-dev.

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

3 participants