# Where's debug kit?

**URL:** <https://discourse.cakephp.org/t/wheres-debug-kit/5453>\
**Category:** Uncategorized\
**Created:** [December 23, 2018, 12:03am UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453 "2018-12-23T00:03:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![calzone](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/calzone/32/305_2.png) [@calzone](https://discourse.cakephp.org/u/calzone)\
**Post date:** [December 23, 2018, 12:03am UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/1 "2018-12-23T00:03:47Z")

</div>

As someone who is not consistently using cake year after year… I always come back after 1-2 years for a new project, download the latest version… and… everything seems broken relative to how it used to be. Meanwhile, the docs are still as unclear and incomplete as ever.

It’s very very hard to stay in love with this platform.

With that out of the way: I have a baked controller + view that’s not showing any records (all the other tables have records showing in their views). I looked at the bottom of the page to try to find the trusty cake icon to debug the query to help me figure out why it’s not pulling data… and… nothing.

An hour later and it sounds like what I want is debug\_kit. I guess this isn’t enabled by default anymore. Ugh.

I followed directions to enable it. Nothing. Hm…… must be this bit here about sqllite… since I’m on a VPS where I’m not entirely in control… installing sqlite may or may not be an option but it’s a rabbit hole I’d rather not go down because that means another 3 hours gone before I even find out if this is going to work and whether it’s actually the answer I’m seeking.

So I tried setting up a ‘debug\_kit’ datasource in config/app.php as per the docs… still nothing. Am I doing the right things or is there something I’m missing? How do I get the freakin queries to show up on each page load?

/question

Incidentally, meanwhile I’ve been doing battle with caches that are making development near impossible. I thought under debug mode (development) cake doesn’t use caching? I guess that changed too.

This is all terribly frustrating and the worst part is I do some version of this dance every single time I come back to cake. How is it possible this platform keeps changing so much? It should have been pretty damn mature by 4 years ago already.

/rant

---

<div class="post-metadata">

**Author:** ![Diego](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/diego/32/296_2.png) [@Diego](https://discourse.cakephp.org/u/Diego)\
**Post date:** [December 23, 2018, 6:24pm UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/2 "2018-12-23T18:24:35Z")

</div>

What cake version are you using?  
Debug loads now from Application bootstrap() function:

> $this-\>addPlugin(\DebugKit\Plugin::class);  
> //and if you are trying to use it from a online production domain url you need use this config key before load:  
> Configure::write(‘DebugKit.forceEnable’, true);

Read the migration guides to stay up to date with the changes:  
[https://book.cakephp.org/3.0/en/appendices/3-x-migration-guide.html](https://book.cakephp.org/3.0/en/appendices/3-x-migration-guide.html)

---

<div class="post-metadata">

**Author:** ![calzone](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/calzone/32/305_2.png) [@calzone](https://discourse.cakephp.org/u/calzone)\
**Post date:** [December 23, 2018, 6:37pm UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/3 "2018-12-23T18:37:04Z")

</div>

I’m on the latest 3.7 release.  
The last time I used cake I was on 3.2

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [December 24, 2018, 12:42am UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/4 "2018-12-24T00:42:29Z")

</div>

debugKit can be dangerous and leak confidential info if you use it in stage/prod env thats why its disabled for security reasons

> [@calzone](#):
>
> Incidentally, meanwhile I’ve been doing battle with caches that are making development near impossible. I thought under debug mode (development) cake doesn’t use caching? I guess that changed too.

cake cache in debug is set in [app/config/bootstrap.php at 5.x · cakephp/app · GitHub](https://github.com/cakephp/app/blob/master/config/bootstrap.php#L90)  
you might have also browser cache you can disable ie. in chrome in dev tools in `Network` tab check `Disable cache` checkbox  
there is also possiblity you have `opcache` enabled and depending on your host you might be able to disable it by editing php.ini

> [@calzone](#):
>
> This is all terribly frustrating and the worst part is I do some version of this dance every single time I come back to cake. How is it possible this platform keeps changing so much? It should have been pretty damn mature by 4 years ago already.

php as language is evolving so are apps/frameworks

---

<div class="post-metadata">

**Author:** ![dakota](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dakota/32/1421_2.png) [@dakota](https://discourse.cakephp.org/u/dakota)\
**Post date:** [December 29, 2018, 10:33am UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/7 "2018-12-29T10:33:19Z")

</div>

DebugKit has needed sqlite since 3.0 was released.

When setting up the datasource, are you getting any errors? I assume you followed this guide: [Debug Kit - 3.10](https://book.cakephp.org/3.0/en/debug-kit.html#database-configuration).

Cake 3.0+ has always used caches, but the default bootstrap set the cache timeout to a couple of seconds when debug was enabled. This part hasn’t changed. It is possible that your application no longer has this switch?

> How is it possible this platform keeps changing so much?

Well, the entire PHP ecosystem is rapidly evolving. 4 years ago, PHP 7 wasn’t on the horizon and Composer was only just starting to gather steam.

There is very little fundamentally different between 3.7 and 3.2, various APIs have been cleaned up, things have been deprecated, but most stuff still works the same.

> Am I doing the right things or is there something I’m missing?

Since it’s not working, I can only assume that you are missing something 🙂 Hard to say what though, could you post your app.php and other relevant files?

---

<div class="post-metadata">

**Author:** ![calzone](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/calzone/32/305_2.png) [@calzone](https://discourse.cakephp.org/u/calzone)\
**Post date:** [December 29, 2018, 5:35pm UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/8 "2018-12-29T17:35:14Z")

</div>

> [@dakota](#):
>
> DebugKit has needed sqlite since 3.0 was released.

I was not able to use Composer this time and downloaded the latest version from GitHub. I’m guessing Composer is supposed to set up sqlite and that is why it worked for me before but not now. However that wouldn’t quite explain why it’s not working even after I set up a datasource for it in my MySQL database… nor why it would silently fail to load instead of throwing errors, considering I set it up per the Book’s instructions.

> [@dakota](#):
>
> Cake 3.0+ has always used caches, but the default bootstrap set the cache timeout to a couple of seconds when debug was enabled.

My problem is that the model caches seem to be extremely aggressive. The only way I can get things to work if I am also making changes to db table names and fields is by manually going into my tmp/caches and deleting all the files by hand. I wouldn’t expect such aggressive db schema caching on a development site and I’ve never had this problem in the past. Why this is happening now as opposed to before? Who knows.

---

<div class="post-metadata">

**Author:** ![dakota](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dakota/32/1421_2.png) [@dakota](https://discourse.cakephp.org/u/dakota)\
**Post date:** [December 30, 2018, 5:36pm UTC](https://discourse.cakephp.org/t/wheres-debug-kit/5453/9 "2018-12-30T17:36:43Z")

</div>

> [@calzone](#):
>
> I’m guessing Composer is supposed to set up sqlite

Composer can’t install sqlite, it’s a PHP extension that needs to be installed at the OS level. Most likely you had sqlite installed previously, and don’t know.

> [@calzone](#):
>
> I was not able to use Composer this time and downloaded the latest version from GitHub

Which link/download did you use? There is one that _should_ work without composer, but via composer is the only officially supported Cake install method. For shared-hosting where shell access is not available there is the [CakeDC Oven](https://github.com/cakedc/oven) that gives you composer functionality without needing shell access.

> [@calzone](#):
>
> My problem is that the model caches seem to be extremely aggressive.

Check that you have the following code in bootstrap.php

```auto
if (Configure::read('debug')) {
    Configure::write('Cache._cake_model_.duration', '+2 minutes');
    Configure::write('Cache._cake_core_.duration', '+2 minutes');
    // disable router cache during development
    Configure::write('Cache._cake_routes_.duration', '+2 seconds');
}
```

Maybe change the `minutes` to `seconds`.
