【问题标题】:Vagrant, PhpStorm, HHVM and XdebugVagrant、PhpStorm、HHVM 和 Xdebug
【发布时间】:2014-12-18 10:46:24
【问题描述】:

我在让 PhpStorm 和 HHVM 中的内部 Xdebug 在 vagrant box 上正常运行时遇到问题,下面是我的 php.ini。

xdebug.enable=1
xdebug.remote_enable=1
xdebug.idekey="PHPSTORM"
xdebug.remote_host="10.0.2.2"
xdebug.remote_autostart=0
xdebug.remote_connect_back=1

PhpStorm 正在侦听端口 9000,如果我在第一次运行时删除所有远程服务器,PhpStorm 会给我通常的“来自 Xdebug 的传入连接”。

在我选择正确的映射并命中第一个断点后,HHVM 似乎在返回 504 Gateway Time-out 之前挂起。如果我删除断点,那么负载是即时的,所以很明显 PhpStorm 和 Xdebug 似乎正在通信,但调试窗口从不显示任何堆栈信息/断点控件。

有没有大神指点一下,我的想法是: 1)我需要在 Vargrant 盒子上打开一个端口,因为通信挂在某处 2) HHVM / PhpStorm 中的错误(不太可能)

我在 Ubuntu 14.04,Vagrant 1.6.5

VM 也是 14.04,使用 Nginx + HipHop VM 3.4.1,扩展 API:20140829

PhpStorm 8.0.2


我现在已经为 Xdebug 远程连接启用了 vagrant box 的日志记录,这是输出......

Log opened at[2014-12-18 14:59:16]
I: Checking remote connect back address.
I: Remote address found, connecting to 192.168.56.1:9089.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/public/index.php" language="PHP" protocol_version="1.0" appid="9660" idekey="PHPSTORM"><engine version=""><![CDATA[xdebug]]></engine><author><![CDATA[HHVM]]></author><url><![CDATA[http://hhvm.com/]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>

<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="break" reason="ok" command="step_into" transaction_id="5"><xdebug:message lineno="12" filename="file:///var/www/public/index.php"></xdebug:message></response>

<- breakpoint_set -i 6 -t line -f file:///var/www/public/index.php -n 32
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="18" state="enabled"></response>

发生了一件非常奇怪的事情,如果我在 PhpStorm 中单击“添加方法以跳过列表”按钮,它会继续与 XDebug 通信,就像单步执行变量一样,每次单击都会一个...

<- stack_get -i 8
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="8"><stack where="{main}" level="0" type="file" filename="file:///var/www/public/index.php" lineno="12"></stack></response>

最终,在这些“stack_get”调用中的几个以这种方式粗略地单步执行之后,就会显示预期的控件。

有人有什么建议吗?

【问题讨论】:

  • 我现在已将此作为 HHVM 错误提交。
  • 运气好吗?我对 PHPStorm8、vagrant、hhvm 3.6 也有同样的问题
  • 在我们公司,我们用 20 行 python 代码复制了与 hhvm 中的 xdebug 模块的有效通信,它就像一个魅力,在 Jetbrains,当人们问这个问题时,他们从天上掉下来,顺便说一句这种行为在使用 Codebug 时非常相似,我也将向他们提出问题 - 顺便说一句,PHPStorm 9 EAP 和 hhvm 3.7 仍然存在此问题
  • 这对你真的有用吗?我的调试器工作但断点并不总是停在第一个文件......
  • 是的,它对我有用,因为我使用 192.168.56.1 作为我的远程主机 IP 的补丁。

标签: php vagrant phpstorm xdebug hhvm


【解决方案1】:

此问题现已在 github 上关闭:https://github.com/facebook/hhvm/issues/4488

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-18
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 2014-11-23
    • 1970-01-01
    • 2021-03-25
    • 1970-01-01
    相关资源
    最近更新 更多