Skip to content

Commit 9ba567c

Browse files
committed
Improve docs
1 parent 9f0907c commit 9ba567c

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

docker-compose.override.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ services:
1515
environment:
1616
# See https://xdebug.org/docs/all_settings#mode
1717
XDEBUG_MODE: "${XDEBUG_MODE:-off}"
18-
# If you use PHPStorm, this must correspond to the name of the server declared in `Preferences | PHP | Servers`
19-
# Then PHPStorm will use the corresponding path mappings
20-
PHP_IDE_CONFIG: serverName=symfony
2118
extra_hosts:
2219
# Ensure that host.docker.internal is correctly defined on Linux
2320
- host.docker.internal:host-gateway

docs/xdebug.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
The default development image is shipped with [Xdebug](https://xdebug.org/),
44
a popular debugger and profiler for PHP.
55

6-
Because it has a significant performance overhead, Xdebug is disabled by default.
6+
Because it has a significant performance overhead, the step-by-step debugger is disabled by default.
77
It can be enabled by setting the `XDEBUG_MODE` environment variable to `debug`.
88

9-
On Linux, Mac and other Unix-likes:
9+
On Linux and Mac:
1010

1111
```
1212
XDEBUG_MODE=debug docker compose up -d
@@ -20,23 +20,22 @@ set XDEBUG_MODE=debug && docker compose up -d & set XDEBUG_MODE=
2020

2121
## Debugging with Xdebug and PHPStorm
2222

23-
You can use the **Xdebug extension** for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) or [Firefox](https://addons.mozilla.org/fr/firefox/addon/xdebug-helper-for-firefox/) if you want to debug on the browser (don't forget to configure it).
23+
First, [create a PHP debug remote server configuration](https://www.jetbrains.com/help/phpstorm/creating-a-php-debug-server-configuration.html):
2424

25-
If you don't want to use it, add on your request this query parameter: `XDEBUG_SESSION=PHPSTORM`.
25+
1. In the `Settings/Preferences` dialog, go to `PHP | Servers`
26+
2. Create a new server:
27+
* Host: `localhost` (or the one defined using the `SERVER_NAME` environment variable)
28+
* Port: `443`
29+
* Debugger: `Xdebug`
30+
* Check `Use path mappings`
31+
* Absolute path on the server: `/srv/app`
2632

27-
On PHPStorm, click on `Start Listening for PHP Debug Connections` in the `Run` menu.
33+
You can now use the debugger!
2834

29-
Otherwise, you can create a [PHP Remote Debug](https://www.jetbrains.com/help/phpstorm/creating-a-php-debug-server-configuration.html) configuration with the following parameters:
35+
1. In PHPStorm, open the `Run` menu and click on `Start Listening for PHP Debug Connections`
36+
2. Add the `XDEBUG_SESSION=PHPSTORM` query parameter to the URL of the page you want to debug, or use [other available triggers](https://xdebug.org/docs/step_debug#activate_debugger)
3037

31-
* Server:
32-
* Name: `symfony` (must be the same as defined in `PHP_IDE_CONFIG`)
33-
* Host: `https://localhost` (or the one defined with `SERVER_NAME`)
34-
* Port: `443`
35-
* Debugger: `Xdebug`
36-
* Absolute path on the server: `/srv/app`
37-
* IDE key: `PHPSTORM`
38-
39-
You can now use the debugger.
38+
Alternatively, you can use [the **Xdebug extension**](https://xdebug.org/docs/step_debug#browser-extensions) for your preferred web browser.
4039

4140
## Troubleshooting
4241

0 commit comments

Comments
 (0)