Xdebug continue from breakpoint after 5 minutes

I use docker (php 5.6.33 + xdebug 2.5.5) with PhpStorm 2017.3.3, after setting up the xdebug in the docker and PhpStorm, it worked, by that I mean if I refreshed the web page to send the request, the execution paused at the breakpoint I set in the PhpStorm, which was good, the problem was that, after 5 minutes without any manual intervention, it would just leave the breakpoint and continue itself, while I was still active debugging.

As it is often the debugging takes much longer than 5 minutes, Could you help me fix this please? Thanks!

8 comments

Hi there,

It must be your web server settings. Look at settings that have "timeout" in their names. 5 minutes = 300 seconds (usually such timeout values will be in seconds).

Basically ... the web server (or php-fpm perhaps) does not see any output from the PHP script and considers it as "hanged up" so it forces it to close.

That's my best description/explanation. There is definitely nothing from IDE side that would cause that -- it's definitely server side.

0

I know "300 seconds" may suggest that it is apache timeout setting problem, but it is not, from the following xdebug logs, you can see it is PhpStorm's taking the initiative to inform xdebug that it is stopping the connection.

here you see a request from xdebug and a response from PhpStorm

<- context_names -i 16
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="16"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response>

here you see only a response from PhpStorm

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="19" status="stopping" reason="ok"></response>

Log closed at 2018-02-12 11:52:38

 

Is there a parameter in PhpStorm to configure the PHP debug connection timeout?

0

> here you see only a response from PhpStorm

> -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="19" status="stopping" reason="ok"></response>

> Log closed at 2018-02-12 11:52:38

You misunderstood the xdebug log.

That's not a response from PhpStorm -- that's a response from xdebug.

 

>context_names -i 16

That's an example of a command sent from PhpStorm.

 

0

>Is there a parameter in PhpStorm to configure the PHP debug connection timeout?

There is no such setting -- PhpStorm does not issue "enough debugging for you, start coding" sort of commands to xdebug.

0

BTW -- what OS do you use?

I've somehow misread/ignored the "Docker" part...

Here is similar recent thread about Docker on Mac ... and downgrading docker-for-mac solved the issue: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000808670-xdebug-session-continues-some-time-after-hitting-breakpoint

0

 

OS: macOS high sierra

And you're right about the xdebug log. :-)

0

And the link you post is very likely what I am experiencing that after about 5 minutes inactivity (5m30s exactly which is why I did not think it is apache2 timeout, which is 300s), the connection was lost. And it is the same version of docker-for-mac I am using (17.12.0).

0

Have tried in vain by increasing apache timeout to 3600s. Now can be sure it is docker issue. Thanks for your help!!

0

Please sign in to leave a comment.