Search code examples
phpeclipsexdebugeclipse-pdt

XDebug, Eclipse and PHP. Testing a particular Page / Feature


I am just trying xDebug with Eclipse and PDT on windows local machine. The setup is running fine. I am trying to debug a VERY large application built on PHP with heavy use of AJAX. What I wanted to know is, if I want to test a particular feature / page, how to launch the debugging session? Currently, when I launch the debugging session it stats from the first page index.php of the application. As the application requires Login, it shows the login page.

How does the debugging work from here (Login page)? Does the login page show up during the debugging session? If yes, then I can enter the U/P and submit. Where does the debugging session go from here? I can't step through here, I am assuming, as it requires User input.

Now, assuming, I logged in. I need to start debugging a particular feature on the application. How is it done?

Thanks much!


Solution

  • I don't know how well Eclipse handles arbitrary incoming debugging connections, but you can instruct Xdebug to initiate a connection by setting a cookie. There is a bunch of nice browser extensions that helps you with this. Each of those extensions allows you to turn on the debugger for a specific request by just clicking a little icon. The xdebug documentation has links to them: http://xdebug.org/docs/remote#browser-extensions

    cheers, Derick