title: Yii2 Gii Forbidden code 403 You are not allowed to access this page
body: <p>I have a <code>server</code> machine and I am trying to allow my PC ip address to use <code>gii</code>.</p>
  
  <p>My PC ip address is <code>192.168.1.101</code></p>
  
  <p>The <code>server</code> machine ip is <code>192.168.1.102</code>.</p>
  
  <p>I used <code>composer</code> to install the <code>gii module</code>.</p>
  
  <p>This is how my <code>composer.json</code> settings look like:</p>
  
  <pre><code>"require": {
          "php": "&gt;=5.4.0",
          "yiisoft/yii2": "*",
          "yiisoft/yii2-bootstrap": "*",
          "yiisoft/yii2-swiftmailer": "*",
          "yiisoft/yii2-gii": "*"
      },
      "require-dev": {
          "yiisoft/yii2-codeception": "*",
          "yiisoft/yii2-debug": "*",
          "yiisoft/yii2-gii": "*",
          "yiisoft/yii2-faker": "*"
      },
  </code></pre>
  
  <p>I have used <code>php init</code> and <code>composer update</code> and <code>php yii migrate</code>.</p>
  
  <p>I am also logged in in the <code>frontend</code>.</p>
  
  <p>This is the <code>main.php</code> file content:</p>
  
  <pre><code>return [
      'id' =&gt; 'app-frontend',
      'basePath' =&gt; dirname(__DIR__),
      'bootstrap' =&gt; ['gii'],
      'controllerNamespace' =&gt; 'frontend\controllers',
      'components' =&gt; [
          'user' =&gt; [
              'identityClass' =&gt; 'common\models\User',
              'enableAutoLogin' =&gt; true,
          ],
          'log' =&gt; [
              'traceLevel' =&gt; YII_DEBUG ? 3 : 0,
              'targets' =&gt; [
                  [
                      'class' =&gt; 'yii\log\FileTarget',
                      'levels' =&gt; ['error', 'warning'],
                  ],
              ],
          ],
          'errorHandler' =&gt; [
              'errorAction' =&gt; 'site/error',
          ],
      ],
      'params' =&gt; $params,
      'modules' =&gt; [
          'gii' =&gt; [
              'class' =&gt; 'yii\gii\Module',
              'allowedIPs' =&gt; ['127.0.0.1', '::1', '192.168.1.101'],
              'password' =&gt; '123456'
          ],
      ],
  ];
  </code></pre>