Jump to content

php debugging is bugging !


ajoo

Recommended Posts

Hi all, 

 

I configured my localhost to work with Xdebug and then installed the plugins to work with note++. Everything worked fine and I got the sample two line program to work from the terminal as well as from a browser (chrome)  by appending "?XDEBUG_SESSION_START=xyz" after the URL.

 

It worked fine for small programs but for my multi-page application, the appended bit simply disappeared. I guess that's because of jumping to pages on menu clicks where the url is created depending upon the menu button being clicked. Code like :

if(isset($_GET['menu_item']))
{
$menu_item = fcheckPpage($_GET['menu_item']);
switch ($menu_item)
    {
        case "menu1":
        require_once("/some/thing.php");
        break;
		
	case "menu2":
        require_once("some/thingelse.php");
        break;
...

 

Then I tried the same on firefox by first installing the plugin for it which does not require any strings to be appended to the URL. That too got working but crashed each time at the very same place when it encountered the code shown above in the code box. These are the error messages that I got

 

cYjv691.png

and 

laDjYGx.png

 

 

It is clear that the the moment the application / program generated it's own url the link to the debugger is lost. Seems like a woeful limitation, I could try and append the XDEBUG... string to the end of each of the generated urls but that would not be a very pretty solution if that did work. 

 

If anyone has any suggestions or solutions or an alternative to this I will grateful. 

 

Thanks all.

Edited by ajoo
Link to comment
Share on other sites

Hi !

 

I found the issue. No xDebug has no limitation.  :)

 

It was a a configuration issue. I did not set an IDE KEY in the DBGP config.

 

So if I set my IDE KEY to 'ide_key'   then the String appended to the end of the URL should be

XDEBUG_SESSION_STRING='ide_key'.

 

That seems to fix it.

 

Thanks all. 

Link to comment
Share on other sites

It worked fine for small programs but for my multi-page application, the appended bit simply disappeared. I guess that's because of jumping to pages on menu clicks where the url is created depending upon the menu button being clicked.

You only need the first URL to have that query string - it tells XDebug to begin the debugging session. If you lose the query string after, that's fine (and it's expected) and your debugging session will continue. So jump between pages to your heart's content.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.