PhpStorm调试问题 [英] PhpStorm debug issue
问题描述
我在使用PhpStorm的本地apache服务器上调试应用程序时遇到问题.Apache启动后,第一次达到断点,这是一个很好的行为,我可以调试部分代码.但是,然后我在Web浏览器中刷新页面,并且断点不再存在,直到我重新启动apache为止.重新启动apache之后,我可以到达断点了-但只是第一次.
你们中有人遇到过这样的问题吗?
- PhpStorm 2020.3
- PHP 7.2.20
- Xdebug v2.7.2
这是在PhpStorm 2020.3中修复了 WI-51991 的结果–完成根据Xdebug作者的要求(Xdebug票证#1756 ).
严重Xdebug 2.9.3及更早版本 出现错误(票号1766)会在此特定PHP过程的剩余时间内关闭远程调试(这就是为什么只有第一个请求有效的原因)-已在Xdebug 2.9.4中修复.
解决方案:
将Xdebug升级到2.9.6或更高版本(最新版本是适用于2.x分支的Xdebug 2.9.8和适用于v3的3.0.1)–已确认可以在多个人那里正常工作.>
看起来像您在Windows上.在这种情况下,请在此处获取最新版本: https://xdebug.org/download (只需获取正确的版本,我相信您需要"PHP 7.2 VC15 TS(64位)": 2.9.8 )
替代方法:继续使用以前的2020.2.4或等待2020.3.1,其中将为Xdebug v2.x实现一些解决方法( WI-57577 )- 2020.3.1预览版本已经可用;最终版本应在本月晚些时候发布.
注释:
- 由Derick Rethans发表的评论(Xdebug作者)
- Xdebug 2.9是不再受支持
- 如果您决定使用Xdebug v3(应使用;它适用于PHP 7.2)-它使用DIFFERENT配置参数,因此请仔细阅读 解决方案
- 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.
这篇关于PhpStorm调试问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!