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!

4 Answers 4

5

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

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

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. )

1 Comment

This works and so do my breakpoints! The only problem is the page launches to myurl.com/app/webroot/index.php which throws an error. I would like to be at myurl.com/index.php.
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.