-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to use PHP Xdebug without sidecar? #15740
Comments
I'd also like to loop in @gorkem and @amisevsk having read the discussion here https://www.eclipse.org/lists/che-dev/msg03362.html, it looks like exactly this was being discussed |
/cc @tsmaeder @vrubezhny |
The way debugging currently works in Che, for a sidecar plugin like PHP, is
For PHP specifically, I don't have the background to give a definitive answer, but I'm able to get remote debugging as described above working for the
With this I'm able to hit breakpoints in the index.php when loading the page. I was kind of working through this manually, but most of this could easily be automated (e.g. there's a configure sites-available command already there). |
@amisevsk this is fantastic, thank you. I can confirm that just by enabling the config below for xdebug in our dev container:
it is able to communicate with Theia debugger. I think I had misunderstood how the plugin sidecar worked because the first test I did was using a "Launch currently open script" launch command. This I believe launches the said script in the xdebug plugin sidecar (correct me if I'm wrong). Whereas the listen action works when the site is browsed via the dev container. Thanks again! |
I'm glad I was able to help!
This is correct, and also is the focus of the che-dev email you mentioned; many default debug configs in VS Code and Theia are launch configs, which usually means launching the application locally (either in the Theia or plugin sidecar container). This can often work (for simple projects), but the canonical way to do it is using remote debugging. |
@amisevsk thanks again! Would I be right in thinking that if our dev container has everything the plugin needs, we could use the vscode plugin directly without needing the che xdebug sidecar (to save on overall memory) |
@davidwindell Not quite, there's additional machinery we have to run to make each plugin It may be possible to combine the plugin and main dev container, though this is currently not a supported option and I don't know how it would shake out. You can, however, try to reduce the memory allotted to the xdebug sidecar in your devfile, if memory usage is a concern, though determining whether there's enough memory in a container can be tricky. |
Ah, and now I can see the .vsix reference in the docs https://www.eclipse.org/che/docs/che-7/using-a-visual-studio-code-extension-in-che. Cheers |
The development image we use for our workspace, already has PHP 7 and Xdebug installed on it.
How do we get this working with Che7/Theia so that the xdebug in the development container is able to communicate with the debugger in theia?
I can see there is a plugin for the
felixfbecker/vscode-php-debug
but this seems to start a new sidecar container without all the php modules we need (whereas these are already installed on the dev container).I guess we need to be able to point our xdebug to the right internal host/port somehow?
The text was updated successfully, but these errors were encountered: