0

I have integrated gii module in my My config file

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

        ),

    ),

I accessed gii by using the following URl.

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

I have got an output

You are not allowed to access this page.

Please help me

NitheesBavesh
  • 163
  • 1
  • 4
  • 18

1 Answers1

0

This problem is almost always caused due to ipfilters. A quick way to test is by setting the ipfilters to false. Once it works the correct ip address to update can be found using the command Yii::app()->request->userHostAddress. Your gii in main.php should look something like this

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

        ),
gpr
  • 485
  • 1
  • 5
  • 15
  • If I add password then also it shows display like same before. – NitheesBavesh Jun 26 '14 at 10:06
  • 1
    Did you set the ipfilters? – gpr Jun 26 '14 at 10:08
  • Note you must not set the ipfilter as I have shown in the example, this is for test purpose , Ideal way to do this is `'ipFilters' => array('127.0.0.1', '192.168.1.7'),` where 192.168.1.7 is your ip address – gpr Jun 26 '14 at 10:11
  • Then also My output like same :( – NitheesBavesh Jun 26 '14 at 10:13
  • can you paste your gii config in main.php along with the ipfilters? – gpr Jun 26 '14 at 10:13
  • 'modules' => array( 'gii' => array( 'class'=>'system.gii.GiiModule', 'password'=>'admin', 'ipFilters'=>array('192.168.1.200','192.168.1.200'), /*'generatorPaths' => array( 'vendor.cornernote.gii-prefixmodel-generator', //'ext.gii-prefixmodel-generator', // if you downloaded into ext ),*/ ), ), – NitheesBavesh Jun 26 '14 at 10:15
  • One way to check if you have configured the correct ip address is to display the output of this command in any view page `Yii::app()->request->userHostAddress` . For testing purpose I would also try to set it to `'ipFilters' => false` and see if that resolves the issue. – gpr Jun 26 '14 at 10:20