Search code examples
yii2gii

Yii2 Gii : You are not allowed to access this page


I'm using Yii2 advance template and I can access gii tool successfully in my local machine. But when I upload it into real server, there is a message "You are not allowed to access this page." Could you tell me which file should I have to config and could you print screen or paste the whole content of that config file?

Thanks you before hand.


Solution

  • You should simply add your IP address in gii config :

    'gii' => [
        'class' => 'yii\gii\Module',
        'allowedIPs' => ['127.0.0.1', '::1'] // adjust this to your needs
    ],
    

    http://www.yiiframework.com/doc-2.0/guide-start-gii.html

    EDIT : in advanced app, gii conf is in

    • environments/dev/backend/config/main-local.php
    • environments/dev/frontend/config/main-local.php