I am having trouble getting PHPStorm 2020.2 to work with xdebug with the following setup:
WSL2 running Ubuntu 20, with php and php-xdebug installed. Whenever I run my tests with debugging enabled it says "Connection was not established.".
This is what the xdebug log shows:
 Log opened at 2020-08-14 17:20:45
 I: Connecting to configured address/port: 172.18.48.1:9006.
 E: Time-out connecting to client (Waited: 200 ms). :-(
 Log closed at 2020-08-14 17:20:46
This is for CLI only, I'm not trying to connect via php-fpm (so no apache, nginx, ...).
So far I have tried:
- Changing the port to something other than 9000 (portscans also reveal that none of them are in use).
- Adding a firewall rule to allow incoming requests as described in https://github.com/microsoft/WSL/issues/4585#issuecomment-610061194 (as well as restarting a couple times after adding the rule)
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
- Adding options like `xdebug.remote_enable=1` to the config, but this is being done by PHPStorm anyways when it runs the remote php instance (`remote_connect_back` also did not do the trick):
[wsl://UBUNTU2004]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9006 -dxdebug.remote_host=172.18.48.1 /home/spaceemotion/code/xxxxxx/backend/vendor/phpunit/phpunit/phpunit [rest ommitted]
Any help would be much appreciated!