|
| 1 | +--- |
| 2 | +title: Prebuilt binaries |
| 3 | +--- |
| 4 | + |
| 5 | +import ConsoleSample from '@site/src/components/ConsoleSample'; |
| 6 | + |
| 7 | +Every release ships ready-built binaries on the |
| 8 | +[Releases page](https://github.com/php-debugger/php-debugger/releases): a complete |
| 9 | +PHP **interpreter** with the debugger compiled in, and the **extension** on its own. |
| 10 | +Nothing is compiled on your machine, and no installer is involved — you download a |
| 11 | +file and put it somewhere. |
| 12 | + |
| 13 | +The catch is that you pick the right file yourself. Get it wrong and PHP either |
| 14 | +refuses to load the extension or fails to start. |
| 15 | + |
| 16 | +## Work out what you need |
| 17 | + |
| 18 | +Three things have to match your PHP: the **minor version**, the **thread safety**, |
| 19 | +and your **platform**. |
| 20 | + |
| 21 | +```bash |
| 22 | +php -v # 8.4.x -> you want the php8.4 files |
| 23 | +php -i | grep "Thread Safety" # disabled -> nts, enabled -> ts |
| 24 | +php-config --extension-dir # where the extension has to go |
| 25 | +``` |
| 26 | + |
| 27 | +`Thread Safety => disabled` means you want the `nts` files, which is what a normal |
| 28 | +CLI or PHP-FPM build is. `enabled` means `ts`. |
| 29 | + |
| 30 | +## File names |
| 31 | + |
| 32 | +Builds are published for PHP 8.2 to 8.5, thread-safe and not, on Linux, macOS and |
| 33 | +Windows, for both `arm64` and `x86_64`: |
| 34 | + |
| 35 | +| What | File | |
| 36 | +| --- | --- | |
| 37 | +| Interpreter | `php-php8.4-nts-linux-arm64` | |
| 38 | +| Interpreter (Windows) | `php-php8.4-nts-windows-x64.exe` | |
| 39 | +| Extension | `php-debugger-php8.4-nts-linux-arm64.so` | |
| 40 | +| Extension (Windows) | `php_php-debugger-php8.4-nts-windows-x64.dll` | |
| 41 | + |
| 42 | +Swap `8.4` for your PHP version, `nts` for `ts` if your build is thread-safe, and |
| 43 | +the platform for yours — `linux`, `macos` or `windows`, with `arm64` or `x86_64` |
| 44 | +(`x64` on Windows). |
| 45 | + |
| 46 | +## The interpreter |
| 47 | + |
| 48 | +A single self-contained file. Download it, make it executable, and run it: |
| 49 | + |
| 50 | +```bash |
| 51 | +curl -fsSL -o php-debugger \ |
| 52 | + https://github.com/php-debugger/php-debugger/releases/latest/download/php-php8.4-nts-linux-arm64 |
| 53 | +chmod +x php-debugger |
| 54 | +./php-debugger -v |
| 55 | +``` |
| 56 | + |
| 57 | +<ConsoleSample>{`PHP 8.4.23 (cli) (built: Jul 2 2026 20:39:24) (NTS) |
| 58 | +Copyright (c) The PHP Group |
| 59 | +Zend Engine v4.4.23, Copyright (c) Zend Technologies |
| 60 | + with PHP Debugger v__VERSION__, Copyright (c) 2002-2026, by Derick Rethans`}</ConsoleSample> |
| 61 | + |
| 62 | +Put it on your PATH if you want it to be the `php` you run. Nothing needs |
| 63 | +enabling — the debugger is compiled in, debugging is on by default, and every |
| 64 | +request starts a session. |
| 65 | + |
| 66 | +## The extension |
| 67 | + |
| 68 | +Download the `.so` into your extension directory, then load it from `php.ini`: |
| 69 | + |
| 70 | +```bash |
| 71 | +curl -fsSL -o "$(php-config --extension-dir)/php_debugger.so" \ |
| 72 | + https://github.com/php-debugger/php-debugger/releases/latest/download/php-debugger-php8.4-nts-linux-arm64.so |
| 73 | +``` |
| 74 | + |
| 75 | +```ini |
| 76 | +zend_extension=php_debugger.so |
| 77 | +``` |
| 78 | + |
| 79 | +It must be `zend_extension`, not `extension` — the debugger hooks into the engine |
| 80 | +and has to be registered as a Zend extension. Check it loaded: |
| 81 | + |
| 82 | +<ConsoleSample>{`$ php -v |
| 83 | +... |
| 84 | + with PHP Debugger v__VERSION__, Copyright (c) 2002-2026, by Derick Rethans`}</ConsoleSample> |
| 85 | + |
| 86 | +If PHP starts but the debugger is missing, or you get a "Zend Extension build ID" |
| 87 | +mismatch, the file does not match your PHP — check the version and thread safety |
| 88 | +again. |
| 89 | + |
| 90 | +:::note[On macOS] |
| 91 | + |
| 92 | +A file downloaded through a **browser** is quarantined, and Gatekeeper will refuse |
| 93 | +to run it. Downloading with `curl` as shown avoids that. If you did use a browser, |
| 94 | +clear the flag once: |
| 95 | + |
| 96 | +```bash |
| 97 | +xattr -d com.apple.quarantine ./php-debugger |
| 98 | +``` |
| 99 | + |
| 100 | +::: |
| 101 | + |
| 102 | +## Staying up to date |
| 103 | + |
| 104 | +There is nothing to update these for you — download the newer file and replace the |
| 105 | +old one. The [installer](../installation.mdx) does this with `php-debugger update` |
| 106 | +if you would rather not track releases yourself. |
0 commit comments