Possibly a moronic question

Hi Yii-ers !

I’m currently in the process of learning Yii2 and decided to dive in at the deep end and straight into the advanced App.

It looks relatively straight forward (having a background in PHP) but I wanted to make sure I’m doing what it says on the tin as the docs keep referring to the Yii-Basic app :S

Right I’ll cut to the chase…

Have a VSERVER running on Local Network which is used for debugging and hosting,etc. Yii2-advanced is uploaded and configured to run in development mode.

I can’t get the debug toolbar to appear unless I edit the Yii2-debug\Module.php and add my IP mask 192.168.1.* to the $allowedIPs variable.

Basically, am I correct in doing this as I feel it should be done in the app config files i.e. common\main.php ?

Don’t want to get into bad habbits!


You are correct with "I feel it should be done in the app config files".

General Rule: Never change files inside vendor directory.

The reason you don’t see the debug toolbar is:

Per Default it is limited to

You can change it in config files like:

$config['modules']['debug'] = [

    'class' => 'yii\debug\Module',

    'allowedIPs' => ['*'], // allow  with * all IP addresses to see debug toolbar



Ah ha,

Many thanks!

I’ve also found that half my problem setting the allowedIPs came from \frontend\config\main-local.php there’s some lines:

if (!YII_ENV_TEST) {

    // configuration adjustments for 'dev' environment

    $config['bootstrap'][] = 'debug';

    //$config['modules']['debug'] = 'yii\debug\Module';  //I had to comment this out as it was obviously clearing my array,      grrr! This appears everytime I init a brand new Yii-advanced on Linux!

    $config['bootstrap'][] = 'gii';

    $config['modules']['gii'] = 'yii\gii\Module';


Thanks for your help!