Skip to content

Support for xdebug in local development with docker#587

Open
ArgusKay99 wants to merge 3 commits intophparkitect:mainfrom
ArgusKay99:add-xdebug
Open

Support for xdebug in local development with docker#587
ArgusKay99 wants to merge 3 commits intophparkitect:mainfrom
ArgusKay99:add-xdebug

Conversation

@ArgusKay99
Copy link

Feature Request

Q A
New Feature yes
RFC yes
BC Break yes

Summary

Can we add xdebug to the docker-container? I created a multi-stage Dockerfile that can be built with and without xdebug.

For context: I am developing on linux with Phpstorm and use the the Docker-container that is created in the CONTRIBUTING.md file as remote PHP interpreter and when there is a xdebug installed, i can already debug unit-tests.

I'm open to suggestions to use xdebug in another way.

BC Break for local development:
docker image build will now need a target: docker image build --target php_build -t phparkitect .

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.12%. Comparing base (1d1af31) to head (1333913).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #587   +/-   ##
=========================================
  Coverage     98.12%   98.12%           
  Complexity      663      663           
=========================================
  Files            84       84           
  Lines          1923     1923           
=========================================
  Hits           1887     1887           
  Misses           36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fain182
Copy link
Collaborator

fain182 commented Mar 10, 2026

Hey @ArgusKay99, thanks for the PR!
Really appreciate the effort to add xdebug support 👍

One thing I noticed — the PR installs xdebug 3.4.0 but the configuration uses remote_enable and remote_autostart, which I believe are Xdebug 2.x directives. In 3.x those should be silently ignored, so I'm wondering if the debugger would actually work as expected?
Could you double-check? Maybe I'm missing something 🙂

- seperate xdebug-install and xdebug.ini so we can do fast experiments with the xdebug ini
- remove deprecated xdebug2-options
@ArgusKay99
Copy link
Author

Hey @fain182 , oh thanks for noticing. I fixed this.

Debugging the unit-tests works fine. This is because apparently my ide did set all the correct environment variables. So as long xdebug is installed and configured in php.ini it will work.

image

Another Thing i noticed is that the tests can run and can be debugged, but will be shown as terminated. This seems to be the problem because the entrypoint is phparkitect (which i cannot change without destroying some workflows) so i'm unsure if it is smart to run xdebug in the same container? Out of curiosity how are you debugging php-arkitect? Maybe i'm just working "wrong".
image

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