xdebug won't stop at breakpoint
Solution 1
If xdebug do not stop in any part of your code, add xdebug_break()
to this part of the code.
Solution 2
There seem to be several issues that could be the root of this problem. In my case it was the fact that I thought I needed to set some path mapping.
The settings found under
rightclick-project->properties->PHP Debug
and then
server->edit->path mapping
were wrong.
I had manually added something I though was correct, but Eclipse can do this all by its self it seems. Removing the mapping made it work.
Solution 3
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.
Solution 4
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!
Solution 5
I had the same problem. The solution is to open correct file and add breakpoint in it.
My local server is on my virtual Z: drive (I'm using denwer instead of WAMP). Z drive points to my D:/webserver folder. So I can open my file as 1) Z:/myproject/script.php and as 2) D:/webserver/myproject/script.php
For some reasons debugger stops on breakpoints only in openned Z:/myproject/script.php file.
How to test my solution??? Do next:
- Open any php file you want to debug
- Add
xdebug_break()
to any line and save file - Run debug
In my case after debug process has started my phpDesigner IDE open correct file in IDE and stops at xdebug_break() line. So in this new opened file you can add breakpoints and they will work. Use opened file for debug.
RedPaladin
Updated on December 09, 2020Comments
-
RedPaladin over 3 years
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