You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/xdebug.md
+14-15Lines changed: 14 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@
3
3
The default development image is shipped with [Xdebug](https://xdebug.org/),
4
4
a popular debugger and profiler for PHP.
5
5
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.
7
7
It can be enabled by setting the `XDEBUG_MODE` environment variable to `debug`.
8
8
9
-
On Linux, Mac and other Unix-likes:
9
+
On Linuxand Mac:
10
10
11
11
```
12
12
XDEBUG_MODE=debug docker compose up -d
@@ -20,23 +20,22 @@ set XDEBUG_MODE=debug && docker compose up -d & set XDEBUG_MODE=
20
20
21
21
## Debugging with Xdebug and PHPStorm
22
22
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):
24
24
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`
26
32
27
-
On PHPStorm, click on `Start Listening for PHP Debug Connections` in the `Run` menu.
33
+
You can now use the debugger!
28
34
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)
30
37
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.
0 commit comments