# Debug cake using xdebug

**URL:** <https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167>\
**Category:** Need Help\
**Created:** [February 26, 2017, 3:53pm UTC](https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167 "2017-02-26T15:53:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![h4\_shinob](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@h4\_shinob](https://discourse.cakephp.org/u/h4_shinob)\
**Post date:** [February 26, 2017, 3:53pm UTC](https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167/1 "2017-02-26T15:53:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shubhrajyoti](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shubhrajyoti/32/544_2.png) [@shubhrajyoti](https://discourse.cakephp.org/u/shubhrajyoti)\
**Post date:** [February 27, 2017, 11:23am UTC](https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167/2 "2017-02-27T11:23:42Z")

</div>

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) ?\>

---

<div class="post-metadata">

**Author:** ![h4\_shinob](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@h4\_shinob](https://discourse.cakephp.org/u/h4_shinob)\
**Post date:** [February 27, 2017, 11:50am UTC](https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167/3 "2017-02-27T11:50:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![h4\_shinob](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@h4\_shinob](https://discourse.cakephp.org/u/h4_shinob)\
**Post date:** [February 27, 2017, 12:25pm UTC](https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167/4 "2017-02-27T12:25:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shubhrajyoti](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shubhrajyoti/32/544_2.png) [@shubhrajyoti](https://discourse.cakephp.org/u/shubhrajyoti)\
**Post date:** [February 27, 2017, 12:26pm UTC](https://discourse.cakephp.org/t/debug-cake-using-xdebug/2167/5 "2017-02-27T12:26:16Z")

</div>

Ohh really it’s sounds good 🙂
