yii gii 访问不了

http://localhost/path/to/index.php?r=gii

出现一下情况,

Forbidden (#403)

You are not allowed to access this page.

The above error occurred while the Web server was processing your request.

Please contact us if you think this is a server error. Thank you.

 

解决方法:

加上  'allowedIPs'=>['*']

实例

if (!YII_ENV_TEST) {

    // configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
'allowedIPs'=>['*']
];

$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs'=>['*']
];
}

posted on 2019-08-18 15:22  少杨  阅读(636)  评论(0编辑  收藏  举报