Debugging (xdebug) works on first page only

Hi there,

I've configured xdebug on my local environment according to the JetBrains docs. Breakpoints work fine on the very first request. However, when I click any links, subsequent breakpoints to not trigger.

I see

?XDEBUG_SESSION_START=10886

getting added to the first request URI. Subsequent requests (clicking on links in the page) do not have anything added to the URI. Is this okay?

For some reason, the debug sessions does not seem to "persist". Any idea?

1 comment

Hi Ralf,

I've configured xdebug on my local environment according to the JetBrains docs.

What docs specifically?

I recommend following this one -- works just fine: http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

Check other articles there as well -- you may find some useful stuff there on other topics.

getting added to the first request URI. Subsequent requests (clicking on links in the page) do not have anything added to the URI. Is this okay?

Generally speaking -- no. But that depends on how you initiate such debug session.

Xdebug needs special cookie (or GET parameter) to be present in request or to be configured to debug every single request automatically (which is not recommended and simply annoying). If such debugging cookie/parameter is not present, then xdebug does not initiates debug connection on subsequent page request. Just use the technique described in that link -- works fine for me all the time. The bookmarklets (that sets/removes such cookie) can be found here: http://www.jetbrains.com/phpstorm/marklets/

0

Please sign in to leave a comment.