Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Create ddev utility xdebug-diagnose to consolidate the many known debugging techniques #8003

@rfay

Description

@rfay

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

Most people have no trouble using xdebug, and it works out of the box, but when people do have problems, they find it tedious and sometimes don't follow the instructions anyway.

Describe your solution

Create a ddev utility xdebug-diagnose along the lines of the new ddev utility mutagen-diagnose added in e661e0e

It should be implemented in go and should attempt to do all the things suggested in the troubleshooting section in https://github.com/ddev/ddev/blob/main/docs/content/users/debugging-profiling/step-debugging.md

  • Detect whether IDE is already listening on host port 9003; if it is, require that to be fixed before continuing
  • Listen on host on port 9003 (all interfaces, 0.0.0.0)
  • Connect to host.docker.internal:9003 from inside web container (ddev exec) using nc to connect; should be possible then to send text both ways in that connection.
  • Disconnect from inside web container
  • Use ddev xdebug enable to enable xdebug
  • Do a simple PHP operation which will then connect to the listening host-side interface (which can then be analyzed)

It should also report all the key details we'd normally expect in a tool like this:

  • IP address of host.docker.internal
  • How that address was derived
  • Ability to ping that address from inside web container
  • Status of global xdebug_ide_location and whether it is the default or not (it's usually an error if it's not the default)

Describe alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions