简体   繁体   English

调试停留在PhpStorm上

[英]Debugging stuck on PhpStorm

The debugging is not working anymore on any of my PhpStorm project, when I start listening to incoming connection the script is blocked until I stop to listen to connections, even if I have no breakpoints on my code. 在我的任何PhpStorm项目中,调试都不再起作用,当我开始侦听传入的连接时,脚本将被阻塞,直到我停止侦听连接,即使我的代码上没有断点也是如此。 And when I put a breakpoint on the first line (it's not working on others lines), the script is indeed stopped, but when I tell him to go to next line it block again (even with the simplest code possible). 当我在第一行上放置一个断点(在其他行上不起作用)时,脚本确实停止了,但是当我告诉他转到下一行时,它再次阻塞了(即使使用了最简单的代码)。

I tried to check the debug configuration everything is ok (I used the validator from PhpStorm), the path mapping is also ok, well last week everything worked fine and I changed nothing so ... 我试图检查调试配置,一切正常(我使用了PhpStorm的验证器),路径映射也正常,上周一切正常,我什么都没改变...

Here is my configuration on my php.ini : 这是我在php.ini上的配置:

xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log=[path]/xdebug.log
xdebug.idekey=PHPSTORM

And here are some part of my xdebug.log when i put a breakpoint on first line then do a step over : 这是我的xdebug.log的一部分,当我在第一行上放置断点然后执行以下操作时:

[4605] Log opened at 2019-03-12 14:13:50
[4605] I: Connecting to configured address/port: 127.0.0.1:9000.
[4605] I: Connected to client. :-)
[...]
[4605] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="19" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" [...] </property></response>
[...]
[4605] <- step_over -i 21
[4605] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="21" status="break" reason="ok"><xdebug:message filename="file:///[path]" lineno="4"></xdebug:message></response>
[4605]

The first response is when it stopped on the breakpoint on the first line, I have everything working fine with variables as "$_COOKIE" logged, then I do the step over, and the script is like stuck. 第一个响应是它在第一行的断点处停止时,我已使用“ $ _COOKIE”记录了变量,一切正常,然后执行了一步,脚本就像卡住了。 And the problem can't be in the code, I tried with a script with only 2 "echo". 而且问题不可能出在代码中,我尝试了只有2个“ echo”的脚本。 I tried to restart apache, I tried to restart PhpStorm, and I tried to restart my computer, nothing changed. 我尝试重新启动apache,尝试重新启动PhpStorm,然后尝试重新启动计算机,但没有做任何更改。

My PhpStorm version : 我的PhpStorm版本:

PhpStorm 2018.1
Build #PS-181.4203.565, built on March 28, 2018
JRE: 1.8.0_152-release-1136-b20 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-102-generic

My php version : 我的PHP版本:

PHP 7.1.27-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar  7 2019 20:02:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.27-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans

Do you have any idea of what is hapening ? 您对发生的事情有任何想法吗? (it seems my php version was built last week, maybe it's linked ...) (看来我的php版本是上周构建的,也许是链接的...)

I found the answer, it's a non compatibility between phpstorm 2018.1 and Xdebug 2.7.0, as it was signaled on this xdebug bug report : https://bugs.xdebug.org/view.php?id=1637 我找到了答案,这是phpstorm 2018.1和Xdebug 2.7.0之间的不兼容,因为在此xdebug错误报告中已指出: https ://bugs.xdebug.org/view.php?id = 1637

I upgraded phpstorm to the version 2018.3, and now everything is fine. 我将phpstorm升级到版本2018.3,现在一切都很好。

I've been running into the same issue this morning. 今天早上我一直在遇到同样的问题。 I believe one of the latest updates to Xdebug (which was officially updated ~6 days ago?) might have broken the build for PHP 7.1.x. 我相信Xdebug的最新更新之一(大约在6天前正式更新?)可能破坏了PHP 7.1.x的版本。 I uninstalled the current xdebug version and used a cached version that I had locally inside the apt cache. 我卸载了当前的xdebug版本,并使用了本地在apt缓存中的缓存版本。 I think LazyOne might be onto the right track with Xdebug 2.6.1 being the version we need. 我认为LazyOne可能会走上正确的道路,而Xdebug 2.6.1是我们需要的版本。

Cached packages available here (on ubuntu): /var/cache/apt/archives/ 可用的缓存软件包(在ubuntu上): /var/cache/apt/archives/

Listed and grepped for xdebug - which listed an older cached package that included 2.6.1. 列出并grepped xdebug-列出了包含2.6.1的较旧的缓存程序包。

cd /var/cache/apt/archives/

ll | grep xdebug

And installed the older package using sudo dpkg -i packagename where packagename was the previous version I had cached. 并使用sudo dpkg -i packagename安装了较旧的软件包,其中packagename是我缓存的先前版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM