SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xDebug only working some of the time

    Hey all.

    I was wondering if anyone was familiar with this issue - I have at least a couple of projects/files where I can use xDebug to step through the code, but in all the others I've tested it on I just get the browser up and it says "Debug session terminated".

    Let's take one of the files I failed to debug as an example, it's called Bridge.php. I went to project > PHP debugger and selected enable project specific settings, and then selected xDebug and applied it. Then when I attempted to debug it, the browser came up and the debug session was terminated right away. Now, when I look at the debug history, I notice that it says that the server debugger for Bridge.php is the Zend Debugger. I have no idea how this happens, since I've already changed the project settings, and also changed my preferences from Zend to xDebug.

    Has anyone here encountered this before?

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,815
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    I haven't used Eclipse in years, but maybe try closing the project after making the change and re-opening it? Maybe the value is being cached on the opening of the project?
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  3. #3
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    I haven't used Eclipse in years, but maybe try closing the project after making the change and re-opening it? Maybe the value is being cached on the opening of the project?
    It might have something to do with that. I tried re-launching but no luck.

    However - whenever I press F11 (debug) on a new file, it will give me a "Debug PHP Web Application" pop-up, asking for the launch url. The right path is in there by default. However when I relaunch and press F11 on the files that aren't working, I don't get that pop-up. So it might be some.. saved.. setting, but it isn't fixed by a re-launch.

  4. #4
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed - I uhm, had to go to properties on the file, go to Run/Debug settings, and edit the existing launch configuration for the file. In there I selected xDebug, applied, clicked OK, applied again on the first screen, and clicked OK. Then it ran successfully.

  5. #5
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have one related question though - if I want to see a code run that only runs if I click a button on my generated webpage, how can I do that?

  6. #6
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,815
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    You would need to set a breakpoint on that particular code section, start the debugger, and run through your application, press the button and it should trigger your breakpoint.
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  7. #7
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thankyouthankyouthankyou.

    You might have just saved me countless hours trying to figure my issue out ^^


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •