Advanced Gii 提示 403

来源:互联网 发布:java设置test字体大小 编辑:程序博客网 时间:2024/06/03 20:21

1- 首先检查下/console/config/main-local.php是否有Gii组件

  1 <?php  2 return [  3     'bootstrap' => ['gii'],  4     'modules' => [  5         'gii' => 'yii\gii\Module',  6     ],  7 ];

2- 在/host/frontend/config.php中加入允许ip组

  1 <?php  2   3 $config = [  4     'components' => [  5         'request' => [  6             // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation  7             'cookieValidationKey' => 'lFqOLA3QvRRj5hbwEfO9R4OJb49dveX0',  8         ],  9     ], 10 ]; 11  12 if (!YII_ENV_TEST) { 13     // configuration adjustments for 'dev' environment 14     $config['bootstrap'][] = 'debug'; 15     $config['modules']['debug'] = [ 16         'class' => 'yii\debug\Module', 17     ]; 18  19     $config['bootstrap'][] = 'gii'; 20     $config['modules']['gii'] = [ 21         'class' => 'yii\gii\Module', 22         'allowedIPs' =>              ['127.0.0.1','198.181.45.103','59.58.112.119'], 23     ]; 24 } 25  26 return $config;