-
Notifications
You must be signed in to change notification settings - Fork 0
Xdebug
Technomantus Corvi edited this page Sep 5, 2026
·
1 revision
sudo apt install php-xdebug
sudo phpenmod xdebug
php -v # should show: with Xdebug v3.x.x, ...php --ini # find the config file locationAdd (typically /etc/php/8.1/mods-available/xdebug.ini):
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9003xdebug.mode=debug is required for step debugging (develop alone does NOT work). Verify:
php -i | grep -i "xdebug.mode\|xdebug.start_with_request"Install PHP Debug (xdebug.php-debug) in Antigravity/VS Code.
{
"version": "0.2.0",
"configurations": [
{ "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003 }
]
}Don't add
pathMappingsfor purely local dev (editor and server on the same machine) — a wrong or placeholder value leaves breakpointsunresolvedand they never trigger. (Docker is different — see Docker.)
- Select "Listen for Xdebug", press F5.
-
php -S localhost:8050 -t public public/index.php(from the project root). - Set breakpoints, visit
http://localhost:8050.
- Confirm something listens on the port:
sudo ss -ltnp | grep 9003 - Enable Xdebug's own log to diagnose:
xdebug.log=/tmp/xdebug.log
xdebug.log_level=7Check cat /tmp/xdebug.log after a request — look for whether breakpoint_set shows resolved or unresolved. unresolved usually means a pathMappings mismatch or that the breakpoint file path doesn't match what's actually being executed.