Vagrant, PhpStorm, HHVM and Xdebug
Asked Answered
G

1

6

I'm having problems getting PhpStorm and the internal Xdebug in HHVM playing nicely on a vagrant box, below is my 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 is listening on Port 9000, if I remove all remote servers upon first run PhpStorm gives me the usual "Incoming Connection from Xdebug".

After I select the correct mapping and the first breakpoint is hit HHVM appears to hang before returning a 504 Gateway Time-out. If I remove the breakpoint then the load is instant, so clearly the PhpStorm and Xdebug appear to be communicating, but the debug window never shows any stack info / break point controls.

Does anyone have any pointers please, my thoughts are: 1) I need to open a port on the Vargrant box as communication is hanging somewhere 2) Bug in HHVM / PhpStorm (Unlikely)

I'm on Ubuntu 14.04, Vagrant 1.6.5

VM is also 14.04 with Nginx + HipHop VM 3.4.1, Extension API: 20140829

PhpStorm 8.0.2


I have now enabled logging on the vagrant box for Xdebug remote connections, this is the output....

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>

A very peculiar thing happens though, if I click the "Add method to skip list" button in PhpStorm, It continues communicating with XDebug as if stepping through variables, one with each click...

<- 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>

Eventually the expected controls are shown after several of these "stack_get" calls have been hackily stepped through in this manner.

Does anybody have any suggestions?

Grande answered 18/12, 2014 at 10:46 Comment(5)
I've now filed this as a HHVM bug.Grande
Any luck? I am having same problem with PHPStorm8, vagrant, hhvm 3.6Biathlon
in our company we replicated with 20 lines of python code a working communication with the xdebug module inside hhvm and it works like a charm, at Jetbrains they fall from the sky when people ask about this issue, btw this behaviour happens quite similar using Codebug and i'm going to file an issue to them too - btw the issue is still present with PHPStorm 9 EAP and hhvm 3.7Baudoin
Did this actually work for you? my debugger works but breakpoints dont it always stops at the first file....Hoppe
Yes it works for me, since the patch I am using 192.168.56.1 as my remote host ip.Grande
G
2

This issue has now been closed on github: https://github.com/facebook/hhvm/issues/4488

Grande answered 23/6, 2015 at 8:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.