无法访问yii中的gii模块


Cannot access gii module in yii

我已经在我的配置文件中集成了gii模块

 'modules' => array(
        'gii' => array(
            'class'=>'system.gii.GiiModule',
             'password'=>'pick up a password here',
            'generatorPaths' => array(
                'vendor.cornernote.gii-prefixmodel-generator',
            ),
        ),
    ),

    'urlManager'=>array(

        'urlFormat'=>'path',
        'rules'=>array(
            'gii'=>'gii',
            'gii/<controller:'w+>'=>'gii/<controller>',
            'gii/<controller:'w+>/<action:'w+>'=>'gii/<controller>/<action>',
        ),
    ),

我使用以下URl访问gii。

http://local_host/_demo/index.php/gii/

我有一个输出

You are not allowed to access this page.

请帮帮我

这个问题几乎总是由ip过滤器引起的。一种快速的测试方法是将ipfilters设置为false。一旦它工作,可以使用命令Yii::app()->request->userHostAddress找到要更新的正确ip地址。你在main.php中的gii应该看起来像这样

'modules'=>array(
                // uncomment the following to enable the Gii tool
                'gii'=>array(
                        'class'=>'system.gii.GiiModule',
                        'password'=>'admin',
                  // If removed, Gii defaults to localhost only. Edit carefully to taste.
                        'ipFilters'=>false,
                ),
        ),