Access to debugger is denied due to IP address restriction

/public_html/yii/basic/basic/config/web.php





    //http://stackoverflow.com/questions/26315808/yii2-gii-forbidden-code-403-you-are-not-allowed-to-access-this-page

    //When in doubt check the logs. There is a warning in there that should tell you something like

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

    $config['modules']['gii'] = [

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

        'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*' ,  '192.168.56.*', '75.157.241.9']

    ];

2015-12-18 06:34:52 [192.168.56.1][-][c8qrbae4q8tjtpqbstdtvtnr17][warning][yii\debug\Module::checkAccess] Access to debugger is denied due to IP address restriction. The requesting IP address is 192.168.56.1

in /home/me/domains/brownhanky.com/public_html/yii/basic/basic/views/layouts/main.php:70

Also tried ‘192.168.56.1’, Both that and * fail. Now I am unsure what to look for…

I do so:


if (YII_DEBUG) {

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

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

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

        'allowedIPs' => ['*'],

    ];

}


if (YII_ENV_DEV) {

    $config['modules']['gii'] = [

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

        'generators' => [

            'crud' => [

                'class' => 'yii\gii\generators\crud\Generator',

                'templates' => [

                    'Custom CRUD' => Yii::getAlias('@backend/views/_gii/crud')

                ],

            ],

            'model' => [

                'class' => 'yii\gii\generators\model\Generator',

                'templates' => [

                    'Custom model' => Yii::getAlias('@backend/views/_gii/model')

                ],

            ],

        ]

    ];

}

Thank you.

Strange.

[’*’] does not work

[$_SERVER[‘REMOTE_ADDR’] does not work

Adding for both YII_ENV_DEV and YII_ENV_TEST makes no difference.

Hacking the source works!


	

class Module extends \yii\base\Module implements BootstrapInterface

	    public $allowedIPs = ['127.0.0.1', '::1', '192.168.56.*']; //dsm

		

class Module extends \yii\base\Module implements BootstrapInterface

    public $allowedIPs = ['127.0.0.1', '::1', '192.168.56.*'];//dsm	



What does that tell me, I wonder?

BINGO! Thank you

The difference is YII_DEBUG

The default was for YII_ENV_DEV