Yii2 Gii : You are not allowed to access this page

6.1k views Asked by At

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.

1

There are 1 answers

1
soju On BEST ANSWER

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