0

我在我的配置文件中集成了 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.

请帮我

4

1 回答 1

0

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

'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,
                ),

        ),
于 2014-06-26T10:02:51.440 回答