Local Community

Debug with Local in VSCode

Issue Summary

I have changed PHP versions and I can not make VSCode debugging with any of my sites in Local neither nginx /apache or php 7.4.30 or php 8.1.9. Previously (just a few days ago ) debugging worked perfectly. My OS is Windows. I have tried restarting Local and VSCode several times also.
Some info here:

In VSCode user settings I have
“php.validate.executablePath”: “C:\Program Files (x86)\Local\resources\extraResources\lightning-services\php-7.4.1+18\bin\win64\php.exe”,
“php.debug.executablePath”: “C:\Program Files (x86)\Local\resources\extraResources\lightning-services\php-7.4.1+18\bin\win64\php.exe”,

launch.json is on public folder inside ./vscode folder

{

"version": "0.2.0",

"configurations": [

    {

        "name": "Listen for Xdebug (Local)",

        "type": "php",

        "request": "launch",

        "port": 9000,

        "xdebugSettings": {

            "max_children": 128,

            "max_data": 1024,

            "max_depth": 3,

            "show_hidden": 1

        }

    },

    {

        "name": "Launch currently open script",

        "type": "php",

        "request": "launch",

        "program": "${file}",

        "cwd": "${fileDirname}",

        "port": 9000,

        "xdebugSettings": {

            "max_children": 128,

            "max_data": 1024,

            "max_depth": 3,

            "show_hidden": 1

        }

    }

]

}

it seems as of phpinfo that xdebug is v3. Checked xdebug website.
But still not working:
Changes in php.ini.hbs
According

xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.idekey = VSCODE

Useful functions :
//phpinfo();
//xdebug_info();
//var_dump(php_ini_loaded_file(), php_ini_scanned_files());

It seems debugging is not enabled

Changed port to 9003, but still not working.

This is what I have in user space settings.json and is working.

Thanks, I have copied your values.
Still does not work.

I am not sure about PHP executable.
I have changed in VSCode File > Preferences > Settings in PHP Debug extension:
“php.validate.executablePath”: “C:\Users\ignasi\AppData\Roaming\Local\lightning-services\php-7.4.30+1\bin\win64\php.exe”,
“php.debug.executablePath”: “C:\Users\ignasi\AppData\Roaming\Local\lightning-services\php-7.4.30+1\bin\win64\php.exe”,

Notice double \ , because \ is an escaping character.

Using xdebug_info() i find that debugger is not started. So , I assume the problem is with Local.

And there is a wrong setting

xdebug.mode = develop,

that should be

xdebug.mode = debug.