WSL2 Xdebug PhpStorm 连接到客户端超时

问题描述 投票:0回答:1

我知道这个问题已经被问过很多次了,但我尝试了 20 个其他解决方案,花了一整天的时间,但似乎没有任何效果。

我的 WSL2 在 Ubuntu 20.04 上运行 PHP 7.4 + Xdebug 2.9.2,并在新的 Windows 11 上使用 PhpStorm 2021.2。

php.ini

zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.start_with_request=trigger
xdebug.discover_client_host=no
xdebug.idekey=PHPSTORM
xdebug.remote_port=9003
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_host=172.19.144.1

日志

[29220] Log opened at 2022-01-10 18:54:56
[29220] I: Connecting to configured address/port: 172.19.144.1:9003.
[29220] E: Time-out connecting to client (Waited: 200 ms). :-(
[29220] Log closed at 2022-01-10 18:54:56

$ cat /etc/resolv.conf // nameserver 172.19.144.1

phpstorm xdebug wsl-2
1个回答
0
投票

这是一个简单的网络问题,它是公共网络而不是专用网络,因此端口 9003 被阻止,即使有防火墙规则(包括公共......)。

© www.soinside.com 2019 - 2024. All rights reserved.