Closed GO111MODULE closed 3 years ago
Perhaps you need to modify remote_host
, you should not be able to access Windows by 127.0.0.1
in WSL.
Perhaps you need to modify
remote_host
, you should not be able to access Windows by127.0.0.1
in WSL.
Thanks for you reply,
After following your advice, I have googled and tried 2 ways to find ip address could access Windows from WSL2, all comes out the same ip address ( and I guess that's it? )
# bash
grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'
ipconfig.exe | grep 'vEthernet (WSL)' -A4 | cut -d":" -f 2 | tail -n1 | sed -e 's/\s*//g'
In additional, I have turn off windows defender firewall
# cmd
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
And modified php.ini yasd.remote.host ( also I have tried another port , of course I have modified launch.json too)
Even reboot Windows and WSL2...
Unfortunately, just as the same, it seems not work. XD
WTF, I found my php.ini have a TYPO ysad -> yasd
Thanks, it could successfully debug now !!
And 127.0.0.1
is working, just for me.
Here's my configure if anyone needed:
VS Code launch.json
php.ini
Please answer these questions before submitting your issue. Thanks!
After setting breakpoint and starting debugging (F5) under VS Code, I enter
php -e test.php
under wsl2, and nothing happened.What did you expect to see? The breakpoint should normally work, just like this video - 在IDE中使用yasd调试器.
What did you see instead? Breakpoint doesn't work on vscode.
What is your machine environment used (show your
uname -a
&php -v
&gcc -v
) ?And here's my
launch.json
(cli)
php.ini
php --ri yasd