PhpStorm will automatically add the XDEBUGSESSION cookie to the request, execute it, and stop at the specified breakpoint. When a request is executed, PhpStorm automatically creates a dedicated temporary HTTP Request run/debug configuration for it. You can save it as a permanent run/debug configuration if necessary. 最近用postman发起请求,发现本地phpstrom设置的断点无效,很奇怪,百度了一下解决办法很简单,需要开启postman的phpstrom调试功能phpstrom + xdebug+postman第一步:打开postman,右边找到Cookies 点击Cookies, 填入 XDEBUGSESSION=PHPSTORM 则可调起phpstrom的调试功能第二步.
You swear you didn't do anything. Your Lando + PHPStorm + XDebug was working yesterday and now it's not. Let's realize that we're dealing with a few different components that may not always play well together.
#1 We're using the Lando Drupal 8 recipe
By the way, the docs for Lando mention the recipes and which ones are available. For those interested in the nitty gritty, you can find the details in Github.
At the time of this writing, some of those files were updated a couple months ago.
#2 PHPStorm is always updating
While the folks at Jetbrains are super on it, I believe the settings can get imported incorrectly and you have to tear your hair out to get things right. Pro tip: there's a thing called Jetbrains Toolbox which lets you have multiple versions of an app.
I'll spare the lengthy philosophical discussion on 'how to live your best debugger life' but certainly a chapter would be, 'slowly eliminate could-be's.' It 'could-be' my version of PHPStorm? Use Jetbrains Toolbox and find out. Wasn't that? Move on to eliminating the next suspect. 🕵️

#3 Docker Desktop is also updating
We ran into an issue where an .env file was automatically picked up and parsed for environment variables. This wasn't happening with earlier versions of Docker Desktop. So there's another variable to throw into the mix.

So don't beat yourself up if these three (and more) stop playing nicely. We can get it back into balance, even if it's ugly and hairy. Here I'll cover an odd case that I haven't found elsewhere online.
First off, one of the best resources for getting Lando, PHPStorm, and XDebug working is the video and content on this page.
However, PHPStorm might not automatically detect XDebug or stop automatically detecting it. If you follow this video and under 'CLI Interpreters' you see 'Debugger: Not installed' check this out.
This is problematic:
Notice that upon expanding the 'Configuration file' list, xdebug is not listed. Weird.
This is odd, seeing as the .lando.yml file has:xdebug:true
Let's dive into the container using lando ssh
Quick detour:


Are we actually ssh'ing into our container? That's debatable, but like the Lando command says, we're dropping 'into a shell on a service.' Feels very much like ssh'ing.What's going on behind the scenes? I feel like I'm trusting Lando with everything and feel lost!If you're familiar with regular Docker commands, this is essentially running docker exec:
docker exec -it <container_id> bash
Try it yourself by getting the container id for php-fpm via docker psOr instead of trusting me, check out their Github ssh task that calls their Lando engine, which is aliased to docker exec.
Neat, we're learning and demystifying stuff.

End of detour, back on track.
Once you're in the shell you'll see that the …xdebug.ini file is there after all. So let's spit out the contents of that file:
Copy the path to the xdebug.so file and plop that into the 'Debugger extension' then click the icon to refresh:
For good measure, patiently watch that entire video linked above again and don't skip steps.
Lastly, if you're still having issues with XDebug and aren't seeing any errors, try including a custom php.ini file that'll set XDebug logging up. That can help catch errors and guide your StackOverflow searching.
The .lando.php.ini contains:
Phpstorm Setup Xdebug
xdebug.remote_log = ./xdebug.log
Xdebug Phpstorm Cli
I hope this will help folks in a tangle and elucidate what's going on behind the scenes with ever-changing Lando, PHPStorm, and XDebug.
