Reputation: 89
DebugKit
Toolbar do not show at the top-right of my localhost/thegioididong page
.
Upvotes: 4
Views: 7574
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
Reputation: 1175
For CakePHP 3.x:
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.
Check that debugkit plugin is loaded by adding debug(Plugin::loaded('DebugKit'));
at the end of bootstrap.php. This should echo "true".
Add
Add your development TLD to the "safeTld" property. (thanks @mark)Configure::write('DebugKit', ['forceEnable' => true]);
before you load DebugKit.
// Allow e.g. http://foo.bar.dev or http://my-shop.local domains locally
Configure::write('DebugKit.safeTld', ['dev', 'local', 'example']);
Copy or symlink asset plugins running bin/cake plugin assets symlink (use copy on windows)
Docs here.
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
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
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
Reputation: 413
Do you have this in your bootstrap.php file?
if (Configure::read('debug')) {
Plugin::load('DebugKit', ['bootstrap' => true]);
}
Upvotes: 1