Hi all,
I am using the basic app template with Yii2.
Gii looks great according to the manual but I keep getting a 403 error when I try to run it using …web/index.php?r=gii
Manual says to add this:
’gii’ => [
’class’ => ’yii\gii\Module’,
’allowedIPs’ => [’127.0.0.1’, ’::1’, ’192.168.0.*’, ’
192.168.178.20’] // adjust this to your needs
],
I have added it (and changed that last IP address to what I need) into the components part of config/web.php like this:
…
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => true,
],
] ‘gii[’ => [
'class' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', 'my.ip.address.here'] // adjust this to your needs
],
'log' => [
…
At the end, this file has:
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = 'yii\gii\Module';
}
and web/index.php has at the top:
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);
defined(‘YII_ENV’) or define(‘YII_ENV’, ‘dev’);
What have I done wrong?
Thanks for any help