Fixed Yii 2.0 Debug Tool not display correct

One day, When I copy a new project from exist Yii 2.0 project, I found the Debug Tool not show correct, so I did the follow check:

1.open /frontend/config/main-local.php file, make sure config correct

<?php
/**
 * frontend dev level config
 */
$config = [];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];

}

return $config;

 

2. use chrome open frontend page, open Inspect->Network (sometime need refresh here), try find URL

http://localhost/YiiLib/frontend/web/index.php/debug/default/toolbar?tag=5715bf7912bee

I found it with a 404 Not Found

Not Found (#404): Unable to find debug data tagged with '5715c055a3a3a'.

It's more clear, 

 

3. check write permission for 

/frontend/runtime
/frontend/runtime/debug

 

Tips: it's a good idea always make sure write permission for the follow path when you start a new project

runtime/*
web/*