Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xdebug won't stop at breakpoint

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 
like image 836
RedPaladin Avatar asked Oct 26 '10 08:10

RedPaladin


People also ask

Why xdebug not working?

Xdebug cannot connect to PhpStorm This means that Xdebug tries to connect to the host and can't make the connection. To fix the issue, set xdebug. remote_connect_back=0 ( xdebug. discover_client_host=false for Xdebug 3) and make sure that xdebug.

How do I disable xdebug in composer?

As of Xdebug 3, it is possible to disable the Xdebug completely by setting the option xdebug. mode to off , or by setting the environment variable XDEBUG_MODE=off . It is very easy to disable Xdebug just for composer, by aliasing composer . You can add the alias to your $HOME/.

Does breakpoint stop before or after line?

The breakpoint will stop your program just before it executes any of the code on that line. Set a breakpoint at line linenum in source file filename .


2 Answers

If xdebug do not stop in any part of your code, add xdebug_break() to this part of the code.

like image 72
Freeman Avatar answered Sep 28 '22 05:09

Freeman


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.

like image 45
Nanne Avatar answered Sep 28 '22 03:09

Nanne