|
2 | 2 | title: IDE Support |
3 | 3 | --- |
4 | 4 |
|
5 | | -PHP Debugger works seamlessly with any IDE that supports the DBGp protocol, including PhpStorm, VS Code, and Neovim. |
| 5 | +If you have debugged PHP from your editor before, there is almost certainly nothing |
| 6 | +to change. PHP Debugger speaks the same [protocol](../reference/debug-protocol.md) |
| 7 | +your editor already knows, on the same port it already listens on. No plugin, no |
| 8 | +adapter, no new configuration. |
6 | 9 |
|
7 | | -:::note |
8 | | -This page is a work in progress — full documentation is coming soon. |
9 | | -::: |
| 10 | +What does change is not the setup. It is a few habits. |
| 11 | + |
| 12 | +## Three habits worth adopting |
| 13 | + |
| 14 | +**Stop worrying about turning it on.** Out of the box the debugger is always |
| 15 | +available: every request starts a session and connects the moment your editor is |
| 16 | +listening. There is no trigger to set, no browser extension to click, no |
| 17 | +`?XDEBUG_SESSION_START=1` to remember, and no separate configuration to switch |
| 18 | +between "debugging" and "not debugging". If your existing setup has any of that in |
| 19 | +it, you can take it out. |
| 20 | + |
| 21 | +**Listen when you want to debug, and stop when you are done.** This is the switch |
| 22 | +now — your editor's, not the debugger's. Start listening when you want to step |
| 23 | +through something, stop listening when you have finished. With nothing listening |
| 24 | +the debugger tries once, finds no one, and costs you almost nothing for the rest of |
| 25 | +the request. |
| 26 | + |
| 27 | +**Remove your breakpoints once you are finished with them.** Every breakpoint left |
| 28 | +behind is checked on every request for as long as the session lasts. One forgotten |
| 29 | +breakpoint is nothing; twenty of them, accumulated over an afternoon, are a slow |
| 30 | +session that gets blamed on the debugger. Delete them rather than disabling them — |
| 31 | +a disabled breakpoint is cheaper, not free. |
| 32 | + |
| 33 | +Together these replace the old routine of enabling the debugger for the work and |
| 34 | +disabling it afterwards. Leave it on; control the session from your editor instead. |
| 35 | + |
| 36 | +## Editor guides |
| 37 | + |
| 38 | +The two editors most PHP developers use have a page each, covering how to use each |
| 39 | +one with the debugger: |
| 40 | + |
| 41 | +- [PhpStorm](./phpstorm.md) |
| 42 | +- [VS Code](./vs-code.md) |
| 43 | + |
| 44 | +## Everything else |
| 45 | + |
| 46 | +Any client that speaks DBGp works, and there is nothing specific to do for it. |
| 47 | +Point it at port `9003`, start listening, and debug exactly as you always have. |
| 48 | + |
| 49 | +If your editor's existing PHP debugging setup works today, it will keep working — |
| 50 | +the three habits above are all that is worth revisiting. |
0 commit comments