9

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?

Community
  • 1
  • 1
trejder
  • 17,148
  • 27
  • 124
  • 216

2 Answers2

3

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

mech
  • 2,775
  • 5
  • 30
  • 38
  • 3
    I haven't heard about it and I think I consider giving it a try. But I must admit, that software which claims to have "_last update: January 25, 2011_" (two an a half year!) on last stable and "_last update: February 14, 2013_" (three months!) on last nightly and with "_5 years late_" milestones, doesn't sound to promising, don't you think? – trejder May 15 '13 at 14:18
  • 2
    Very true, but sometimes abandoned software can help. If nothing else, it may work as a bridge of sorts until you can get a better solution. Sorry I can't be of more help, my php experience is of the notepad++-and-lots-of-cursing-at-code kind. – mech May 15 '13 at 14:29
3

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

Martin Fox
  • 33
  • 3