Debug cake using xdebug

I’m new to cakephp and would like to know the best way to run debug line by line to use cacke. I was trying to use Netbenas, but when I run the application cacke does not stop on the marked lines. If anyone knows how I can do this, I appreciate it.

While CakePHP doesn’t offer any tools that directly connect with any IDE or editor, CakePHP does provide several tools to assist in debugging and exposing what is running under the hood of your application.

The debug() function is a globally available function that works similarly to the PHP function print_r(). The debug() function allows you to show the contents of a variable in a number of different ways. First, if you’d like data to be shown in an HTML-friendly way, set the second parameter to true. The function also prints out the line and file it is originating from by default.

<?php debug($data) ?>

Many thanks I was able to figure out the problem, I use apache as a server. And in my settings, information was missing.
Inside the php.ini I had not informed the folder where php_xdebug runs.
After putting the file path correctly XDebug started to stop at the debug points.
Even so thank you very much helped me a lot because after looking at the settings window that explained to me I understood that the problem was about folder configuration and reference of the same. Thanks!

1 Like

After doing this I was able to install the debug_kit of the tool. I just needed to download debug_kit and include it inside the plugins.
After that I enabled debug_kit inside the directory.
Location of application:
{Local} … \ BlogCacke \ app \ Config \ bootstrap.php
After that I ran the test and it was successful in all configurations.

Ohh really it’s sounds good :slight_smile: