5

I'm developing in NetBeans a CakePHP application and finally managed to get it connecting to XAMPP debugging sessions (PHP 5.3.1 w/ Xdebug v2.0.6-dev).

It perfectly works when launching, it does pause the application on the first line.

However any further breakpoint I set is completely ignored. It does not break nor pause; it just runs to completion.

xdebug.extended_info is set to 1 and I tried with a barefoot php project without any framework magic and there breakepoints worked as expected.

What the hack? I would like to be able to use breakpoints in (Cake)PHP.

Richard Harrison
  • 19,247
  • 4
  • 40
  • 67
sibidiba
  • 6,270
  • 7
  • 40
  • 50
  • 1
    i am curious to see if anybody comes back with an answer for this. – Randy L Oct 24 '10 at 17:04
  • me2 :) This is a major issue to me, I'm unable to debug CakePHP apps. I have the feeling it has something to do with the way Cake is including code pieces. But I'm not sure. It doesn't seem a conf issue. Would be nice to have at least a "worksforme" feedback. – sibidiba Oct 25 '10 at 08:07
  • Do you have triple checked that the execution flow is going to your breakpoint ? – Luc M Oct 31 '10 at 13:13
  • @Luc: I tried both in controller and view code. Breakpoints in views' PHP code are also valid, isn't it? – sibidiba Oct 31 '10 at 21:09
  • Sound less like a programming problem to me. It's more frequently a reinstall task if you're on Windows. Anyway you haven't told us if multiple breakpoints work for other/ordinary PHP scripts. If so, then look for any funny `xdebug_disable()` thingys in Cake. – mario Nov 01 '10 at 09:13
  • @mario: read my post, breakpoints do work in simple PHP apps. Also phpinfo tells me debug is enabled. Also CakePHP apps brake on the first line. But nowhere else after. – sibidiba Nov 01 '10 at 18:10
  • 1
    As per Google it's a common problem http://osdir.com/ml/CakePHP/2009-06/msg00879.html - but some suggested downgrading xdebug helped. Anyway you could still try to remove CakePHPs `xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);` - though I'm not sured it gets activated. Otherwise try debugging with Eclipse to isolate the problem source. – mario Nov 02 '10 at 05:33
  • @mario: thanks for pointing this our. I really wonder how this is messed up with NetBeans. Will try out once I've got home... – sibidiba Nov 03 '10 at 08:44

1 Answers1

6

Try to set the webroot correct to the cake-webroot-dir in project-properties

Another thing, take a look here:

http://groups.google.ch/group/cake-php/browse_thread/thread/73bcf80a3d626c75

Mohammad Mazaz
  • 316
  • 1
  • 7