Debugging CakePHP in Netbeans always stops at index.php

I installed the CakePHP project on Netbeans and use xdebug for debugging. When I start a debugging session, Netbeans stops in the root index.php file for each request. I have to click next and then my breakpoints will be deleted.

Is there a way to configure xdebug to avoid this behavior? This is quite tiring when you need to hit on every request.

Thanks!

+4
source share
4 answers

Answer in another message: here . The problem was not specific to CakePHP, but rather to debug PHP in general with Netbeans.

+5
source

Try setting up your web root folder on APP / webroot. Right-click your project and select properties, and then set the source folder to webroot. Link: cakePHP debug Netbeans

Hope this helps

+4
source

Sujir's answer pointed me in the right direction.

The following worked for me:

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

Now breakpoints work! I am very happy XD

(PS. I just moved from Windows to OS X. No matter what installation you use, make sure you are editing the correct php.ini file. Even PHP veterans like me sometimes still finish editing the wrong stupid file. )

+3
source

Paul is right. This is a netbeans problem, not CakePHP. Uncheck "Stop on the first line." enter image description here

The big problem that many people face is that debugging works as a whole. If you set the index field as user787301, then the debugger will start in webroot / index and throw an error. The solution is to install only Web Root in the project properties -> sources, as suggested by Sugir.

enter image description here

+1
source

Source: https://habr.com/ru/post/1398949/


All Articles