-
open terminal and run
export XDEBUG_CONFIG="idekey=VSCODE"
-
install xdebug for vscode
-
add launch config
{ "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003, "pathMappings": { "/var/www/html": "${workspaceFolder}", } } ] }
-
run
php --ini | grep "xdebug"
on docker image -
add below to
xdebug.ini
zend_extension=xdebug.so xdebug.mode=debug xdebug.start_with_request=yes xdebug.discover_client_host=true
PS:
- incase of laravel/sail, u dont need the above config, just make sure to run the command with
debug
ex.- normal:
sail test ....
- debug:
sail debug test ....
- normal:
- incase of laravel/sail, u dont need the above config, just make sure to run the command with
-
add breakpoints
-
run the debugger on vscode
-
run ur command
Last active
April 26, 2022 12:13
-
-
Save ctf0/3f4bda8c3e0b4216cc2a7411dbc9aec4 to your computer and use it in GitHub Desktop.
docker php xdebug setup for vscode (insider)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment