Question

What is the current state of debugging PHP applications with Eclipse PDT and Xdebug. Has anyone got it finally to work, i.e. to stop at breakpoints defined in Eclipse (not using xdebug_break())?

I've read this over two years old question, but it turned out that even now (May 2013) Helios doesn't stops at breakpoints at all. So, I followed advice and switched to Galileo, only to find out, that it is also not stopping at breakpoints. The only difference I see is that Galileo also ignores Open in Browser setting and always debugs in external webbrowser, which is itself very annoing.

When I have Break at First Line checked, I see Eclipse taskbar icon to blink each time I click any link, but Eclipse clearly doesn't stops on anything -- neither first line nor breakpoints. It executes (renders entire page in external browser, as there would be no debugging at all.

If I uncheck Break at First Line, Eclipse even doesn't react on my clicking in page being debugged. It goes through entire code and stops nowhere.

I'm able to stop by using xdebug_break(), but this is of course a joke. If this is the only option, then I don't need Eclipse and Xdebug at all. I can use notepad and die() to have the same results.

I've read somewhere, that even Galileo doesn't stop on breakpoint and I should install Juno instead. Is there any Eclipse version or package that can be used for debugging PHP apps with Xdebugs and that is able to stop on breakpoints? This has started to become crazy? How many versions should I test?

I've spent (too) many hours on this, reading many different StackOverflow answers, installing three different Eclipse editions, checking and unchecking hundreds of options and restarting Eclipse about million times and ended up with nothing. Would really appreciate any help on this.

Currently working on: Windows 7, Eclipse PDT Galileo SR 2, PHP 5.3, XAMPP.

If there is anyone out there, who was successfully in using Eclipse PDT and Xdebug for debugging PHP application with stopping on breakpoints and with respecting Open in Browser option, can you please provide a simple answer on what to install, configure and check to achieve the same?

Was it helpful?

Solution

Have you tried using PHPEclipse? It seems to work fine when debugging php code with Xdebug.

OTHER TIPS

As you, after many hours spending time on this, finally I found my problem.

I had in my apache virtual host settings (/etc/apache2/sites-enabled/000-default.conf) a ServerName for the working project (name.myproyect.local) and a ServerAlias (www.myproject.local).

And in the debug settings (Run > Debug Configurations > PHP Web Application > Server > PHP Server > Configure...) was set the ServerAlias name (www.myproject.local) as Base Url, I changed to the principal ServerName (name.myproyect.local) and then I had my breakpoints working!!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top