Skip to content

vscode devcontainer support via xdebug#5139

Closed
emestee wants to merge 1 commit intofisharebest:mainfrom
emestee:main
Closed

vscode devcontainer support via xdebug#5139
emestee wants to merge 1 commit intofisharebest:mainfrom
emestee:main

Conversation

@emestee
Copy link
Copy Markdown

@emestee emestee commented Apr 13, 2025

This enables debugging (using xdebug) in vscode

  • Make sure PHP debugger and devcontainer extensions are installed
  • Install docker on your system
  • In .vscode, copy launch.json-devcontainer-dist to launch.json or use its contents for an existing launch.json file
  • Build the devcontainer and switch the workspace to devcontainer

When you run the debug server launch configuration, a PHP webserver inside the devcontainer will start and you will be able to use the vscode debugger: place breakpoints, use watches, catch exceptions, step over etc.

Note that xdebug server runs on your machine and listens on its port 9003. The xdebug client is a php extension that runs in the devcontainer and will connect back to your host, which is why vscode should have port 9003 listed in forwarded ports and it should be green when the web server is running.

- Make sure PHP debugger and devcontainer extensions are installed
- Install docker on your system
- In .vscode, copy `launch.json-devcontainer-dist` to `launch.json` or
  use its contents for an existing launch.json file
- Build the devcontainer and switch the workspace to devcontainer

When you run the debug server launch configuration, a PHP webserver inside the
devcontainer will start and you will be able to use the vscode debugger: place breakpoints,
use watches, catch exceptions, step over etc.

Note that xdebug server runs on your machine and listens on its port 9003.
The xdebug client is a php extension that runs _in_ the devcontainer and will connect
back to your host, which is why vscode should have port 9003 listed in forwarded ports
and it should be green when the web server is running.
@fisharebest
Copy link
Copy Markdown
Owner

I'm going to reject this PR because

  • I'm not convinced that development tools like this belong in the source code.
  • I need to be able to support all the code in the repository. I can't do this because I do not use vscode and I rarely use Docker.

I can see that it would be useful to some developers. Perhaps it would be better to create a separate repository for it, and then create a link from https://webtrees.net to it?

@fisharebest fisharebest closed this Feb 9, 2026
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

Successfully merging this pull request may close these issues.

2 participants