问题
I'm developing a kinda export from one app to another.
PhpStorm PHP debug tool works perfect but I faced an issue: When my debugged Laravel instance sends request to the next application on my local Apache box session freezes because no answer is coming back from the second app.
When I turn off debugging it unfreezes, but run without stopping breakpoints any more and I can`t stop after response arrived any more.
I've tried to turn off all the BPs but that not helped. I am able to debug both apps separately though.
回答1:
Most likely that your 2nd app also sees "debug me" flag and Xdebug tries to debug it (depends on your Xdebug config; most likely you have xdebug.remote_autostart = 1). But because you are already in a debug session it cannot do that and is waiting until first debug session is over (in other words -- limited debug slots).
This is typical situation: debugging website that makes API calls to another/same domain on the same server.
In such situation you should increase the max number of simultaneous debug connections in PhpStorm settings (Settings/Prefeences | Languages & Frameworks | PHP | Debug | Max. simultaneous connections). By default it's just 1, make it 2 or 3 (no need to go into extreme and putting large number -- you are unlikely to see more than 2 debug sessions at once).
This way you can debug 2 requests separately (if all setup correctly) .. or 2nd one will run with no breakpoints triggered.
来源:https://stackoverflow.com/questions/51535684/phpstorm-debug-session-freezes-when-requesting-another-local-php-application