Install XDebug extension on VSCode available here
In the root of your project create a .vscode
folder and inside create a lauch.json
. Put this code inside :
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9001
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9001
}
]
}
Find you php version php -v
and download the xdebug associated to your php version here
Mode the .dll
file to php-path/ext
.
I like to rename my file to php_xdebug.dll
(php_xdebug-2.9.6-7.4-vc15-nts-x86_64.dll
=> php_xdebug.dll
)
I like to rename
Find the path of your php.ini
with php --ini
command.
Open your file and go to the bottom and add (if not already) :
[xdebug]
zend_extension="php-path/ext/php_xdebug.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port=9001
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="C:/xampp/tmp" # Modify it to you own need
xdebug.show_local_vars=0