docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Issues to configure xDebug + PHPStorm + WSL2 (after Docker Update)

Open r1tt3r opened this issue 2 years ago • 2 comments

After docker update its policy and insert paid subscription I'm trying to change the way I run my projects locally. I currently use: Windows WSL -> Ubuntu

So I removed the docker desktop from windows and installed it on ubuntu. I currently have the containers and files on Ubuntu and PHPStorm on Windows.

My problem is in the xDebug configuration, when trying to add a CLI interpreter no option I was successful. I stopped at the part of connecting to the docker daemon:

My Steps:

1- PhpStorm > Preferences > PHP > CLI Interpreter 2 - Create a new interpreter from the From Docker, Vagrant, VM... list. 3 - I selected Docker but no servers are avaliable, then i click in New:

image

4- After that I got stuck because I don't know which option to select:

image

Anyone having the same problem or know how to help? Thanks in advance

r1tt3r avatar Jan 26 '22 16:01 r1tt3r

I'm not sure if this is any help as I'm a Mac user, but I always select Docker Compose, select the two docker-compose.yml and docker-compose.dev.yml files for the config files, and then it automatically finds the Docker images and populates the select dropdowns, which I can then select the phpfpm container.

markshust avatar Feb 02 '22 16:02 markshust

For me I eventually discovered that the Xdebug client was trying to listen on IPv6 and the Xdebug server was trying to connect on IPv4.

I didn't use PHPStorm but for VSCode specifying the IPv4 localhost address (127.0.0.1) as the hostname worked to force it to listen on IPv4.

GamesmenJordan avatar Mar 29 '23 00:03 GamesmenJordan