Fix #270: Add Xdebug configuration recipe#438
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Yii3 cookbook recipe that explains how to configure Xdebug for local PHP and Docker-based workflows, including IDE setup for PhpStorm and VS Code, plus steps for debugging web requests, console commands, and tests.
Changes:
- Add a new cookbook page: “Configuring Xdebug”.
- Document Xdebug configuration for local PHP vs Docker, including IDE path mappings and launch configs.
- Add the new recipe to the cookbook index.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/cookbook/index.md | Adds the “Configuring Xdebug” entry to the cookbook navigation. |
| src/cookbook/configuring-xdebug.md | New recipe covering Xdebug setup, IDE configuration, and debugging workflows (web/CLI/tests) with troubleshooting links. |
| ``` | ||
|
|
||
| Keep the default `SERVER_NAME=:80` from `docker/dev/.env` unless the application needs a different Caddy address. | ||
| Set the browser port with `DEV_PORT` in `docker/.env`: |
Comment on lines
+183
to
+200
| ``` | ||
|
|
||
| 3. Start listening in the IDE. | ||
| 4. Put a breakpoint in an action or middleware. | ||
| 5. Enable debugging in the browser extension and reload the page. | ||
|
|
||
| If the IDE accepts a connection and the breakpoint stays inactive, check path mappings first. | ||
|
|
||
| ## Debug a console command | ||
|
|
||
| Without Docker, start the command with an Xdebug trigger: | ||
|
|
||
| ```shell | ||
| XDEBUG_MODE=debug XDEBUG_SESSION=phpstorm ./yii hello | ||
| ``` | ||
|
|
||
| With Docker, pass the trigger to the container: | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #270.
Adds a cookbook recipe for configuring Xdebug with local PHP and Docker. Covers web requests, console commands, tests, PhpStorm, and VS Code.