2

By choosing Break at First line, the debugger gets active when entering each file, allowing me to step in and out of the code. But it is a bit cumbersome having to tab your way through half a million steps to get to the point where it starts to get interesting.

My setup is WIMP Window 7, PHP 5.3

; xDebug config
zend_extension = "C:\Program Files (x86)\PHP\v5.3\ext\php_xdebug-2.2.1-5.3-vc9-nts.dll"

xdebug.remote_autostart=0;
xdebug.remote_enable=On 
xdebug.remote_host="localhost" 
xdebug.remote_port=9000 
xdebug.remote_handler="dbgp"

I have made sure that the path mapping is correct. But could it be because i'm linking to the PHP files from my Eclipse project?

DevNull
  • 763
  • 5
  • 17
  • 30

4 Answers4

0

After downloading Eclipse Juno i'm able to stop at breakpoints.

I have tried everything with Eclipse Indigo. Version: 3.7.2 Build id: M20120208-0800

Just wont work, either with an internal or external browser.

Time to move on to Juno i guess?

DevNull
  • 763
  • 5
  • 17
  • 30
  • 1
    Oh no !! I'm having the same problem even with Eclipse Juno !! Debugger stops at the first line when "Break at First Line" is checked but not stopping at the line where I set breakpoint after un-checking "Break at First Line". Here is my [SO Question](http://stackoverflow.com/questions/14092105/php-wamp-exlipse-pdt-xdebug-not-stopping-at-breakpoint), can you plz check my settings and tell me what I've done wrong. – Tariq M Nasim Dec 30 '12 at 16:00
-1

Eclipse has an option to turn off "break at first line". Go to "Windows -> Preferences -> PHP -> Debug" and uncheck "Break at first line" and also to go in "Run > Debug Configurations > PHP Web Application" and unselect "Break at first line" in all the configurations. Then restart Eclipse.

Derick
  • 35,169
  • 5
  • 76
  • 99
  • Thanks Derick. I have tried that. Since yesterday i also tried to install Zend. Same problem. The debugger just whizzed through the breakpoints, but stopped at first line when enabled – DevNull Nov 24 '12 at 15:15
  • The very first sentence in the question makes crystal clear that he knows about that option. – Spencer Williams Nov 13 '14 at 23:10
-1

For all those, that are still fighting with this problem, some handy tips.

Check which version (package) of Eclipse you have? It turns out, that Helios package has some bugs and doesn't stops on breakpoints, when you debug your application as Web Application. Debugging works only, if you run it as PHP Script. Which makes it pretty useless for debugging process.

You should consider either reverting to older Galileo Package Eclipse for PHP Developers or installing newest Eclipse Juno (or even newest developer version of Eclipse Kepler), which doesn't have PDT support build in, but you can easily add it to then, using Help > Install New Software.. (point it to http://download.eclipse.org/tools/pdt/updates/release).

These versions are reported to be able to debug as Web Application, respecting breakpoints.

Also, remember, that Xdebug must be run as Zend Extension in order to support breakpoints! In other words remove extension=xdebug.so (on Linux or xdebug.dll on Windows) line from your php.ini and replace it with zend_extension=/full/path/to/xdebug.so (on Linux or zend_extension=X:\full\path\to\xdebug.dll on Windows). Zend extensions requires full path, even if they're put into /php/ext folder, as regular PHP extensions. You'll find more info on this in Xdebug FAQ (look for an answer to "Xdebug is only loaded as PHP extension and not as a Zend Extension" question).

Community
  • 1
  • 1
trejder
  • 17,148
  • 27
  • 124
  • 216
  • I followed "Xdebug must be run as Zend Extension" comment. And then used FireFox (instead of Chrome/internal browser). I think the last step was the one that fixed the problem. – user3149858 Dec 31 '13 at 17:20
-1

Here is a post describing how to get breakpoints to work with XDebug in Eclipse.

http://programmersjunk.blogspot.com/2013/05/eclipse-and-xdebug.html

appcoder
  • 639
  • 1
  • 9
  • 19
  • 6
    Note that link-only answers are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Jul 24 '13 at 06:53