问题
I have the issue with the debugging application on local apache server with PhpStorm. After Apache is started the breakpoint is reached for the very first time, which is a good behavior and I can debug the part of code. However then I refresh the page in web browser and the breakpoint is not reached anymore, until I restart apache. Once apache is restarted I can reach the breakpoint - but just for the very first time.
Has anyone of you had such issue?
回答1:
- PhpStorm 2020.3
- PHP 7.2.20
- Xdebug v2.7.2
This is a result of fixing WI-51991 in PhpStorm 2020.3 -- done on request from Xdebug author (Xdebug ticket #1756).
Sadly Xdebug 2.9.3 and older has a bug (ticket #1766) that turns off remote debugging for the remainder of the duration of this specific PHP process (that's why only first request works) -- fixed in Xdebug 2.9.4.
Solution:
Upgrade Xdebug to 2.9.6 or newer (latest versions are Xdebug 2.9.8 for 2.x branch and 3.0.1 for v3) -- it's confirmed working there by multiple people.
Looks like you are on Windows. In such case get the latest version here: https://xdebug.org/download (just get the right build, I believe you need "PHP 7.2 VC15 TS (64 bit)": v3.0.1 or 2.9.8)
Alt approach: keep using previous 2020.2.4 or wait for 2020.3.1 where some workaround will be implemented for Xdebug v2.x (WI-57577) -- 2020.3.1 Preview build is already available; final version should be released at some point later this month.
NOTES:
- Comment by Derick Rethans (Xdebug author)
- Xdebug 2.9 is no longer supported
- If you decide to use Xdebug v3 (which you should; it's available for your PHP 7.2) -- it uses DIFFERENT config parameters, so please go through Upgrading from Xdebug 2 to 3 Guide and update (mostly rename) your Xdebug config.
来源:https://stackoverflow.com/questions/65322810/phpstorm-xdebug-unable-to-step-through-debugging