rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.84k stars 272 forks source link

Cannot use xDebug with PHPStorm #2980

Open r1tt3r opened 1 year ago

r1tt3r commented 1 year ago

Actual Behavior

Today I'm using Windows + Rancher Desktop + WSL2 to run my containers. I use the WSL with Ubuntu to start my containers. The problem is when the IDE tries to find the PHP interpreter of my container and gets lost along the way. Without the CLI interpreter mapped in IDE I cannot use the xDebug.

Steps to Reproduce

Open PHPStorm and go to settings -> PHP -> CLI Interpreter -> Plus button to create a new:

image

As you can see, PHPStorm is able to find the container with PHP. But didn't find the PHP executable. image

So I connected to the container to get the path of PHP: image

And then I inserted it in the field, but didn't solve the error: image

Result

IDE cannot map the PHP Interpreter and therefore I can't configure xdebug.

Expected Behavior

PHP Interpreter should be mapped by IDE and some functionalities related to it will work.

Additional Information

No response

Rancher Desktop Version

1.5.1

Rancher Desktop K8s Version

1.2.4.4

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11 Enterprise 21H2

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

Fenikkusu commented 1 year ago

While I'm not using WSL, The RD -> PHPStorm XDebug Configuration is working fine for my team and I, both on Windows and OSX. I'm inclined to think there is likely a simply config setting not correct here. IE: Did you define PHP_IDE_CONFIG in your container? Do you have xdebug.remote_host (or whatever it is now) set to host.docker.internal? Have you updated your windows firewall to allow the connection?