1

I'm experimenting with Zend Debugger (Zend server), Firefox with debugger bookmarklet and PHPSTORM. Everything works well, when I'm trying to debug one request, with get or post variables. Problems arise, when there are redirects in the PHP code, and I would like to debug subsequent requests. Example: post / redirect / get controller plugin in Zend Framework 2. What the plugin does is, that after sending a request with post variables, it sends back a redirect to the user, and the same URL is called, but this time without POST variables, but the POST variables are stored in SESSION. (as seen on http://en.wikipedia.org/wiki/Post/Redirect/Get).

My problem, is that although I can debug the POST request, after that request is done, and there is the redirect, PHPSTORM does not stop at breakpoints of the NEXT request (basically debug session is done after the POST request is done, and the next request's debug isn't connected), which is where I would like to debug more.

How can I solve this situation?

Ryan Vincent
  • 4,483
  • 7
  • 22
  • 31
gargatok
  • 11
  • 1
  • What request data such subsequent request has (GET/POST/COOKIE)? Possible subsequent request does not have such "debug me" flag... I'm using xdebug and browsr extension to set xdebug cookie ... and such debugging works fine (plus, I can always configure xdebug to debug every single request regardless of presence of such flag). But I'm not sure how Zend Debugger works in such cases... – LazyOne Apr 28 '15 at 15:08
  • can you add the breakpoint in a conditional? ie: if(is_second_request(){...add break point in here ...} – STLMikey Apr 28 '15 at 16:42
  • I have a non-conditional breakpoint there, but at the second request it simply does not stop, I did not think of adding a condition there. Simply Zend debugger does not connect to the IDE. – gargatok Apr 29 '15 at 15:41
  • It works for me in PHPStorm. After debugging the POST and continuing past the redirect the debugger stopped at the first line of my application again and I was able to debug the redirected GET. – Paul Jan 26 '16 at 03:17

0 Answers0