Mr.D
Mr.D

Reputation: 89

DebugKit in cakephp 3.x do not show DebugKit Toolbar

DebugKit Toolbar do not show at the top-right of my localhost/thegioididong page.

enter image description here

Upvotes: 4

Views: 7574

Answers (6)

Ghazaleh Javaheri
Ghazaleh Javaheri

Reputation: 2117

in my case cake 3.5 this lines of code work

if (Configure::read('debug')) {
    Configure::write('DebugKit', ['forceEnable' => true]);
    Plugin::load('DebugKit', ['bootstrap' => true]);
}

add this line at the end of bootstrap.php

Upvotes: 2

Tomas Gonzalez
Tomas Gonzalez

Reputation: 1175

For CakePHP 3.x:

  1. Check if "debug" is set to true. You may add debug('test'); somewhere in your app and check if you see the word "test" in your website's code at the beginning.

  2. Check that debugkit plugin is loaded by adding debug(Plugin::loaded('DebugKit')); at the end of bootstrap.php. This should echo "true".

  3. Add Configure::write('DebugKit', ['forceEnable' => true]); before you load DebugKit. Add your development TLD to the "safeTld" property. (thanks @mark)

     // Allow e.g. http://foo.bar.dev or http://my-shop.local domains locally
     Configure::write('DebugKit.safeTld', ['dev', 'local', 'example']); 
  1. Copy or symlink asset plugins running bin/cake plugin assets symlink (use copy on windows) Docs here.

  2. Make sure you have sqlite extension installed. If you're using Laragon, enable Sqlite extensions in Menu > PHP > Extensions (this is what fixed my issue).

Upvotes: 1

Benji Castillo Eguez
Benji Castillo Eguez

Reputation: 11

enabled sqlite, for linux mint

nano /etc/php/7.2/apache2/php.ini 

uncomment

extension=sqlite3

restart apache

 service service apache2 restart

Upvotes: 1

Salines
Salines

Reputation: 5769

Try:

bin/cake plugin assets symlink

to load debugkit assets.

Upvotes: 6

Mr.D
Mr.D

Reputation: 89

SOLVED! I do these thing:

1: check the debug status at the top of config\app.php.

`'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),`

2: add to the end of config\bootstrap.php these codes:

`if (Configure::read('debug')) {
Plugin::load('DebugKit', ['bootstrap' => true]);
}`

3: create debug_kit table in mysql database - leave it empty database (localhost/phpmyadmin - in my case), then add:

'debug_kit' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
'username' => 'root',
'password' => 'root1234',
'database' => 'debug_kit', //leave it empty - without tables
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,
'quoteIdentifiers' => false,
'url' => env('DATABASE_URL', null),
],

into config\app.php following this structure:

'Datasources' => [
    'default' => [
        //default database config here
    ],
    'debug_kit' => [
        //debug_kit database config as above
    ],

    'test' => [
        //test database config here
    ],
],

Thanks a lot. I'm sory for my English!

Upvotes: 4

danny3b
danny3b

Reputation: 413

Do you have this in your bootstrap.php file?

if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}

Upvotes: 1

Related Questions