xdebug won't stop at breakpoint

2019-01-23 12:50发布

I spend some hours to set up my IDE to debug PHP with eclipse and xdebug.. Everything is ok except the breakpoint I set on eclipse. If I double-click on a line to add a breakpoint, the debugger want not to stop.. If a add the line xdebug_break() the debugger stops well at the line...

It's maybe a problem with the configuration. Could anyone help me ?

  • Eclipse: Eclipse PDT 2.2.0 All In Ones Windows 32 bits
  • Xdebug: 5.3 VC6 (32 bit)
  • PHP: PHP Version 5.3.3

PHP.ini

[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "c:/temp"
xdebug.collect_params = 4
xdebug.collect_return = on
xdebug.collect_vars = on

xdebug.show_local_vars = 1

19条回答
看我几分像从前
2楼-- · 2019-01-23 12:55

I'm on windows, eclipse Oxygen. After spending fair amount of time, I discovered that simple delete and recreation of Debug Configuration helped.

查看更多
forever°为你锁心
3楼-- · 2019-01-23 12:57

I have fixed myself the problem.

On my php.ini, I have add the xdebug as an extension instead of a zend_extension.

php.ini

zend_extension=C:\EasyPHP-5.3.3\php\ext\php_xdebug.dll

Note: the path must be the full path instead of a relative path.

The debugger works great. Yummy!

查看更多
姐就是有狂的资本
4楼-- · 2019-01-23 13:01

I had the same problem and either one of two things fixed it...

I removed a duplicate zend_extension definition in my PHP.ini

or more likely I just upgraded to the latest xdebug version from here: http://xdebug.org/download.php

(I was running xdebug that came with XAMPP v1.7.1)

THIS STARTED AGAIN... tried all different versions of xdebug dlls, etc... turned out that what was causing this to not work was having the Expressions window open... so keep it closed when you debug stuff... you can add a watch temporarily and then close the Expressions window before you "step"...

bogus...

查看更多
可以哭但决不认输i
5楼-- · 2019-01-23 13:02

I’ve had a similar problem with Eclipse PDT and Xdebug. The cause was that Eclipse was listening via IPv6 but Xdebug tried to connect via IPv4:

chriki@machine:~$ netstat -an | grep 9000
tcp6       0      0 :::9000                 :::*                    LISTEN

Xdebug doesn’t seem to support IPv6, yet.

After adding the line

-Djava.net.preferIPv4Stack=true

after the -vmargs line in my eclipse.ini file, Eclipse started to listen via IPv4:

chriki@machine:~$ netstat -an | grep 9000
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN

Debugging now works flawlessly.

查看更多
Deceive 欺骗
6楼-- · 2019-01-23 13:02

I had the same issue using eclipse-php-oxygen The issue lies on eclipse. I have installed eclipse-php-luna-SR2-win32 and tested xdebug and it works fine.

Installed: xampp-win32-7.0.30-0-VC14-installer.exe Java 8 Update 171

The following are my settings on php.ini:

[XDebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.6.0-7.0-vc14.dll
;zend_extension = C:\xampp\php\ext\php_xdebug-2.5.5-7.0-vc14.dll
;zend_extension = "c:\xampp\php\ext\php_xdebug-2.6.0-7.2-vc15.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
;36000 = 10h
xdebug.remote_cookie_expire_time = 36000

I hope this will help.

Br, Ali

查看更多
神经病院院长
7楼-- · 2019-01-23 13:02

For me the problem seemed to php 7.2 with Xdebug v2.7.0beta2-dev, notice the beta part. This was installed using puphpet.com. I tried php 7.1 and the problem vanished. Took me hours to find this!

查看更多
登录 后发表回答