2

I have installed PHPStorm via snap into WSL version of Ubuntu because of this phpstorm/wsl2 defect I cannot use the Windows version of PHPStorm as it freezes frequently. When it works Xdebug works ok with the Windows version. However, trying to use the Linux version I had no success. Could you advise what needs to be changed when running the Linux version of PHPStorm inside Windows to make xdebug work? (either by using Linux Chromium or Windows Chrome).

What should I set xdebug.client_host? Should I keep it as host.docker.internal or change it?

(verification of Linux version of PHPStorm running in WSl) enter image description here

Handsome Nerd
  • 4,682
  • 17
  • 55
  • 80
  • @Destroy666 `wsl hostname -i` returns `127.0.1.1` and it tried this IP that does not work. Should I use another IP address? How to get it? – Handsome Nerd Jun 22 '23 at 23:33
  • I misread, try whatever IP is in `"$(hostname).local"` since PHPStorm reports WSL2 from what I see. – Destroy666 Jun 23 '23 at 10:48
  • See if [this post](https://docs.google.com/document/d/1W-NzNtExf5C4eOu3rRQm1WlWnbW44u3ANDDA49d3FD4/edit?pli=1) helps. – harrymc Jun 24 '23 at 07:50

1 Answers1

0

I finally found a solution here.

Help -> Edit custom VM options and put this in there:

-Djava.net.preferIPv4Stack=true

See the link for more details. Jamie Holly is a legend to posting the solution.

xdebug.client_host should be host.docker.internal as usual.

Handsome Nerd
  • 4,682
  • 17
  • 55
  • 80