# Debug with Local in VSCode

**URL:** <https://community.localwp.com/t/debug-with-local-in-vscode/33378>\
**Category:** Support\
**Tags:** windows-10, xdebug, vscode\
**Created:** [September 20, 2022, 9:05am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378 "2022-09-20T09:05:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ignasitort](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ignasitort/32/6604_2.png) [@ignasitort](https://community.localwp.com/u/ignasitort)\
**Post date:** [September 20, 2022, 9:05am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/1 "2022-09-20T09:05:36Z")

</div>

### 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
> 
> }
> 
> }
> 
> ]
> 
> ```
> 
> }

---

<div class="post-metadata">

**Author:** ![ignasitort](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ignasitort/32/6604_2.png) [@ignasitort](https://community.localwp.com/u/ignasitort)\
**Post date:** [September 20, 2022, 10:29am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/2 "2022-09-20T10:29:27Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![ignasitort](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ignasitort/32/6604_2.png) [@ignasitort](https://community.localwp.com/u/ignasitort)\
**Post date:** [September 20, 2022, 11:12am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/3 "2022-09-20T11:12:47Z")

</div>

> [@ignasitort](#):
>
> `"port": 9000,`

Changed port to 9003, but still not working.

---

<div class="post-metadata">

**Author:** ![afragen](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/afragen/32/31_2.png) [@afragen](https://community.localwp.com/u/afragen)\
**Post date:** [September 20, 2022, 4:24pm UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/4 "2022-09-20T16:24:34Z")

</div>

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

> <https://gist.github.com/afragen/0e322c8d05d4e3dc0906982005233fc3>

---

<div class="post-metadata">

**Author:** ![ignasitort](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ignasitort/32/6604_2.png) [@ignasitort](https://community.localwp.com/u/ignasitort)\
**Post date:** [September 20, 2022, 5:51pm UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/5 "2022-09-20T17:51:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ignasitort](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ignasitort/32/6604_2.png) [@ignasitort](https://community.localwp.com/u/ignasitort)\
**Post date:** [September 21, 2022, 7:35am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/6 "2022-09-21T07:35:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ignasitort](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ignasitort/32/6604_2.png) [@ignasitort](https://community.localwp.com/u/ignasitort)\
**Post date:** [September 21, 2022, 7:48am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/7 "2022-09-21T07:48:26Z")

</div>

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

 ![imatge](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/0/b/0bb0212c6acabaa5b43ce17b60ee28f1ebf45754.png)

And there is a wrong setting

> xdebug.mode = develop,

that should be

> xdebug.mode = debug.

 ![imatge](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/4/0/40724adddd5fa83e817389c35bf56daeec537514.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [December 20, 2022, 7:49am UTC](https://community.localwp.com/t/debug-with-local-in-vscode/33378/8 "2022-12-20T07:49:02Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
