Can not make PHP PDT xDebug to stop at breakpoints in Eclipse

ぐ巨炮叔叔 提交于 2019-12-10 22:36:49

问题


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?


回答1:


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?




回答2:


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.




回答3:


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




回答4:


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



来源:https://stackoverflow.com/questions/13522671/can-not-make-php-pdt-xdebug-to-stop-at-breakpoints-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!