Zero Configuration
DAMP configures Xdebug automatically:
- Pre-installed in all PHP containers
- VS Code integration ready immediately
- Port forwarding configured automatically
- Path mapping set up correctly
DAMP comes with Xdebug pre-configured and ready to use with VS Code. No complex configuration or setup required - just set breakpoints and start debugging your PHP applications immediately.
Xdebug is a powerful debugging and profiling tool for PHP that provides:
Zero Configuration
DAMP configures Xdebug automatically:
Full Feature Set
All Xdebug features available:
Performance Optimized
Xdebug configured for development:
Open Project in VS Code
Click “Open in VS Code” from your DAMP project card, or open the project folder in VS Code and reopen in DevContainer.
Set a Breakpoint
Click in the gutter next to any line of PHP code to set a breakpoint.
Start Debug Listener
Press F5
or click Run → “Start Debugging” in VS Code.
You’ll see “Listening for Xdebug” in the debug console.
Trigger Code Execution
Make a request to your application:
💡 Tip: To trigger Xdebug debugging from your browser, use the Xdebug Helper Chrome extension. Enable it for your project domain to automatically set the required cookie and activate debugging for your requests.
Debug Interactively
When your breakpoint is hit:
DAMP automatically creates the necessary debug configuration files:
// .vscode/launch.json (auto-generated){ "version": "0.2.0", "configurations": [ { "name": "Launch application", "type": "php", "request": "launch", "program": "${workspaceFolder}/index.php", "cwd": "${workspaceFolder}", "port": 9003 }, { "name": "Listen for XDebug", "type": "php", "request": "launch", "port": 9003 }, { "name": "Launch currently open script", "type": "php", "request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port": 9003 } ]}
; xdebug.ini (automatically configured in container)[xdebug]xdebug.mode = develop,debug,trace,coverage,profilexdebug.start_with_request = triggerxdebug.client_port = 9003
You can customize debug behavior if needed you can find xdebug.ini
file inside .devcontainer
folder
; Different Xdebug modesxdebug.mode=debug # Step debugging onlyxdebug.mode=debug,develop # Debugging + enhanced var_dumpxdebug.mode=debug,coverage # Debugging + code coveragexdebug.mode=debug,profile # Debugging + performance profiling
; Control when Xdebug activatesxdebug.start_with_request=yes # Always debugxdebug.start_with_request=trigger # Only when triggeredxdebug.start_with_request=no # Manual activation only
When debugging is active, use these controls:
F5
) - Resume execution until next breakpointF10
) - Execute current line, don’t enter functionsF11
) - Enter function calls to debug inside themShift+F11
) - Complete current function and returnCtrl+Shift+F5
) - Restart debug sessionShift+F5
) - Stop debuggingLine Breakpoints
Conditional Breakpoints
$user === 'Alice'
Exception Breakpoints
Variables Panel
Watch Expressions
$user
, count($users)
, $this->property
Debug Console
For debugging web pages and API endpoints:
F5
)For debugging Artisan commands or scripts:
php artisan your:command
Enable Xdebug profiling for performance analysis:
; Enable profilingxdebug.mode=debug,profilexdebug.output_dir=/tmp/xdebugxdebug.profiler_output_name=cachegrind.out.%p
Track code coverage during testing:
; Enable coveragexdebug.mode=debug,coverage
Use with PHPUnit:
./vendor/bin/phpunit --coverage-html coverage/
Symptoms: Breakpoints are set but not being hit
Solutions:
php -m | grep xdebug
Symptoms: VS Code can’t connect to Xdebug
Solutions:
php -i | grep xdebug
Symptoms: Debugging is very slow
Solutions:
xdebug.start_with_request=trigger
xdebug.mode=off
Symptoms: Breakpoints in wrong files or not found
Solutions:
{ "pathMappings": { "/var/www/html": "${workspaceFolder}", "/var/www/html/vendor": "${workspaceFolder}/vendor" }}
Get Xdebug information:
# Check if Xdebug is loadedphp -m | grep xdebug
# Show Xdebug configurationphp -i | grep xdebug
# Show loaded extensionsphp --re xdebug
# Test Xdebug connectivityphp -dxdebug.start_with_request=yes -r "var_dump('debugging works');"
Check Xdebug logs for connection issues:
# View Xdebug logtail -f /tmp/xdebug.log
# Common log entries[Xdebug] Could not connect to debugging client[Xdebug] Connected to debugging client[Xdebug] Disconnected from debugging client
With DAMP’s pre-configured Xdebug setup, you can focus on debugging your application logic rather than fighting with debugging tool configuration. Happy debugging!