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.
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.
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.
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.