Laravel Sail debug configuration in Intellij on Windows 10 with wsl2
Environment:
Intellij: IntelliJ IDEA 2022.3.2 (Ultimate Edition) Build #IU-223.8617.56, built on January 25, 2023
Laravel: v10
PHP:
> sail php -v
PHP 8.2.6 (cli) (built: May 12 2023 06:24:00) (NTS): (c) The PHP Group
Zend Engine v4.2.6, Copyright (c) Zend Technologies
with Zend OPcache v8.2.6, Copyright (c), by Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
Docker Desktop: Docker version 23.0.5
This would seem to be more related to phpstorm, but I'm using Intellij Ultimate and have seen various threads around this that implies that Intellij (at that time ~2 years back) hadn't yet supported this so I'm asking here.
Sounding like a broken record with questions generally around xdebug configuration in various environments and here's yet one more. I'm attempting to get the debugger to work in the above mentioned conditions.
I've followed the recommended configuration steps from Laravel Sail's documentation on enabling xdebug from the dockerized container...
1) modifying .env with these:
SAIL_XDEBUG_MODE=develop,debug
XDEBUG_MODE=debug
XDEBUG_CONFIG="client_host=host.docker.internal"
and,
2) as you can see in my environment dumps in the header, xdebug is enabled...
that's working fine, but I can't get Intellij configured so I can hit debug breaks when running backend endpoint code from, i.e., postman (which I've added the "XDEBUG_TRIGGER" query param to calls").
I'm assuming this is a remote debugging setup since I'm running intellij from my windows system to the image and code running on my wsl2 linux box, but can't get it to respond.
Any help would be greatly appreciated.
请先登录再写评论。
Usually in such cases, it's very useful to take a look at the Xdebug log - if Xdebug starts at all, the log should contain records of what it tries to do.
Please configure the log (it's better to create the log file manually and also set 777 permissions on it), reproduce the issue, and check what's going on in the log.