Skip to content

Add Xdebug configuration recipe#438

Open
samdark wants to merge 4 commits intomasterfrom
270-xdebug-setup
Open

Add Xdebug configuration recipe#438
samdark wants to merge 4 commits intomasterfrom
270-xdebug-setup

Conversation

@samdark
Copy link
Copy Markdown
Member

@samdark samdark commented May 7, 2026

Closes #270.

Adds a cookbook recipe for configuring Xdebug with local PHP and Docker. Covers web requests, console commands, tests, PhpStorm, and VS Code.

Copilot AI review requested due to automatic review settings May 7, 2026 07:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/cookbook/configuring-xdebug.md Outdated
Comment thread src/cookbook/configuring-xdebug.md
Comment thread src/cookbook/configuring-xdebug.md
Comment thread src/cookbook/configuring-xdebug.md
Comment thread src/cookbook/configuring-xdebug.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

```

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:

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.

Add tutrorial on configuring XDebug

2 participants