Skip to content

Xdebug

Xdebug 3.5.3, toggled per site, on PHP 8.1 through 8.5.

Terminal window
rex site xdebug myshop.rex on

Or the toggle on the site’s page in the app.

Turning it on starts a separate debug pool for that PHP version and re-points the site at it. Sites without the toggle keep using the normal pool and pay nothing — Xdebug’s overhead is real, and applying it to every site so that one site can be debugged would be a bad trade.

Turning it off moves the site back.

Xdebug connects outward to your editor, so your IDE is the listener and rexenv binds nothing.

  1. Set your IDE to listen on port 9003 — the DBGp default. PhpStorm calls this “Start Listening for PHP Debug Connections”; VS Code needs a launch.json with "type": "php", "request": "launch", "port": 9003.

  2. Map the server path to your local path if your IDE asks. For a rexenv site the docroot is the same folder your editor has open, so the mapping is usually one-to-one.

  3. Set a breakpoint and load the page.

No port configuration is needed inside rexenv, because there is nothing to configure: the version pinned per PHP minor is already wired to the standard port.

If you need step debugging on a legacy codebase, the practical answer is to run it on 8.1 locally while it targets 7.4 in production, or to use logging.

Xdebug’s own support windows close. A PHP minor that has fallen outside the window is frozen at the last Xdebug release that worked with it, rather than being dragged onto a version that does not support it. rex php list shows what each installed version has.