問題描述:
在WSL環境下搭建nginx+php-fpm環境,安裝xdebug擴展后,按照常規的xdebug配置方法進行配置無法進入debug,查看xdebug日志,顯示如下錯誤
[246] Log opened at 2020-08-05 11:09:01
[246] I: Connecting to configured address/port: 127.0.0.1:9009.
[246] W: Creating socket for '127.0.0.1:9009', poll success, but error: Operation now in progress (29).
[246] E: Could not connect to client. :-(
[246] Log closed at 2020-08-05 11:09:01
嘗試在WSL上用telnet去連接127.0.0.1:9009,同樣返回無法連接
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
此時,需要將127.0.0.1改為window下WSL的IP地址,即下圖所示地址

