Skip to content

Commit 0c0c846

Browse files
rewrite quick start page
1 parent 1c38aac commit 0c0c846

1 file changed

Lines changed: 38 additions & 18 deletions

File tree

docs/getting-started/quick-start.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,56 @@
22
title: Quick Start
33
---
44

5-
Get up and running with PHP Debugger in a few minutes. This guide assumes you have already [installed](./installation.mdx) the extension.
5+
You have [installed](./installation.mdx) PHP Debugger. This is everything else —
6+
which, in most cases, is nothing at all.
67

7-
## 1. Enable the debugger
8+
## 1. Load it
89

9-
Add the following to your `php.ini` file:
10+
**If you installed the interpreter** — the build with the debugger compiled in,
11+
which is what the installer and the Docker images give you by default — there is
12+
nothing to load. Skip to step 3.
13+
14+
**If you installed the extension**, one line in `php.ini`:
1015

1116
```ini
12-
zend_extension=php_debugger
13-
php_debugger.mode=debug
14-
php_debugger.start_with_request=trigger
17+
zend_extension=php_debugger.so
1518
```
1619

17-
## 2. Start listening in your IDE
20+
It has to be `zend_extension`, not `extension`.
1821

19-
Configure your IDE to listen for debug connections on port `9003` (the default). See the [IDE Support](../integrations/ide-support.md) guide for instructions for PhpStorm, VS Code, and Neovim.
22+
## 2. Delete everything else
2023

21-
## 3. Set a breakpoint and run
24+
Debugging is on by default and starts with every request, so the settings you may
25+
be used to are unnecessary. Remove them if they are already there:
2226

23-
Set a breakpoint in your editor, then trigger a debug session:
27+
- `php_debugger.mode` (or `xdebug.mode`) — already `debug`
28+
- `php_debugger.start_with_request` (or `xdebug.start_with_request`) — already `yes`
29+
- any line loading Xdebug, such as `zend_extension=xdebug.so` — PHP Debugger takes
30+
its place, and loading both will not work
2431

25-
- **Web request**: add `XDEBUG_TRIGGER=1` as a cookie, GET, or POST parameter.
26-
- **CLI script**: set the trigger in the environment:
32+
There is no trigger to set and no environment variable to remember.
2733

28-
```bash
29-
XDEBUG_TRIGGER=1 php your-script.php
30-
```
34+
## 3. Check where it connects
35+
36+
The debugger connects out to your editor. Two settings decide where:
37+
38+
| Setting | Default |
39+
| --- | --- |
40+
| `php_debugger.client_host` | `localhost` |
41+
| `php_debugger.client_port` | `9003` |
42+
43+
Those are right when your editor and your code run on the same machine. They are
44+
not right from inside a container, where `localhost` is the container itself — see
45+
[Docker](./docker.mdx) for the setup that fixes it.
46+
47+
## 4. Set a breakpoint
48+
49+
Start your editor listening on port `9003`, set a breakpoint, and run your code.
50+
The debugger connects, pauses, and hands you the session.
3151

32-
The debugger connects to your IDE, pauses at your breakpoint, and you can step through code, inspect variables, and evaluate expressions.
52+
See [IDE Support](../integrations/ide-support.md) for PhpStorm, VS Code and Neovim.
3353

3454
## Next steps
3555

36-
- Learn about [breakpoints](../user-guide/breakpoints.md) and [step debugging](../user-guide/step-debugging.md).
37-
- Fine-tune behaviour in the [Configuration](./configuration.md) guide.
56+
- [Breakpoints](../user-guide/breakpoints.md) and [step debugging](../user-guide/step-debugging.md)
57+
- [Configuration](./configuration.md) — everything you can change, if you need to

0 commit comments

Comments
 (0)