4

I've setup a CakePHP project in Netbeans and use xdebug for debugging. When I start a debugging session, Netbeans stops in the root index.php file on every request. I have to press continue and then my breakpoints are hit.

Is there a way to configure xdebug to avoid this behavior? It's pretty tedious having to hit continue on every request.

Thanks!

Paul
  • 3,725
  • 12
  • 50
  • 86

4 Answers4

5

Answer in another post: here. Issue was not specific to CakePHP, but rather PHP debugging in general with Netbeans.

Community
  • 1
  • 1
Paul
  • 3,725
  • 12
  • 50
  • 86
4

Sudhir's answer pointed me into the right direction.

The following worked for me:

  • Go to project properties.
  • Click on Run Configuration.
  • Click browse button next to [Index File] field.
  • Select app/webroot/index.php.

Breakpoints finally working now!!! I am sooo happy XD

( PS. I just made the move from Windows to OS X. Whatever installation you are running, make sure you are editing the correct php.ini file. Even PHP veterans like myself sometimes still end up editing the wrong stupid file. )

Dieter Gribnitz
  • 5,062
  • 2
  • 41
  • 38
  • This works and so do my breakpoints! The only problem is the page launches to http://myurl.com/app/webroot/index.php which throws an error. I would like to be at http://myurl.com/index.php. – Bryan Jan 07 '14 at 17:18
4

Try setting web root folder to APP/webroot. Right click your project and choose properties, then set your source folder to webroot. Ref: cakePHP debug Netbeans

Hope it helps

Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
1

Paul is correct. This is a netbeans issue, not CakePHP. Uncheck "Stop at First Line". enter image description here

The larger issue that many people face is getting debugging working in general. If you set the index field as user787301 suggested, then the debugger will launch to webroot/index and throw an error. The solution is to only set Web Root in project properties -> sources as Sudhir suggested.

enter image description here

Bryan
  • 17,201
  • 24
  • 97
  • 123