nsciolini
(Nicolas)
December 16, 2013, 10:01pm
1
Hi,
I am newbie in Yii2 and I downloaded the basic template and i configured the database. I realized that GII is configured in web.php
if (YII_ENV_DEV) {
$config['preload'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
$config['modules']['gii'] = 'yii\gii\Module';
}
But when i tried to access in index.php?r=gii i get the error 403 Forbidden.
I checked the index.php and YII_ENV_DEV is defined like dev
defined('YII_ENV') or define('YII_ENV', 'dev');
Somebody know what i missing?
Thanks!
yiiABC
(Donguyenha)
December 17, 2013, 3:15am
2
i comment out the line $config[‘modules’][‘gii’] = ‘yii\gii\Module’;
and add new following line into the web.php
[indent] ‘modules’ => [
'gii'=> [
'class' => 'yii\gii\Module',
'allowedIPs' => ['192.168.1.2'],
],[/indent]
Hi,
I am newbie in Yii2 and I downloaded the basic template and i configured the database. I realized that GII is configured in web.php
if (YII_ENV_DEV) {
$config['preload'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
$config['modules']['gii'] = 'yii\gii\Module';
}
But when i tried to access in index.php?r=gii i get the error 403 Forbidden.
I checked the index.php and YII_ENV_DEV is defined like dev
defined('YII_ENV') or define('YII_ENV', 'dev');
Somebody know what i missing?
Thanks!
samdark
(Alexander Makarov)
December 17, 2013, 8:23am
3
nsciolini
(Nicolas)
December 17, 2013, 12:44pm
4
Thanks!!
My problems was the ‘allowedIPs’. I was added the following lines
'allowedIPs' => ['127.0.0.1', '::1', 'localhost']
And my app is hosted in a server so I have to add allowed IPs of my current computer.
I solved with:
'allowedIPs' => ['208.68.37.61']
samdark
(Alexander Makarov)
December 17, 2013, 2:18pm
5
Why do you want Gii on server btw.?
nsciolini
(Nicolas)
December 17, 2013, 10:12pm
6
Because we are a team developing the app and we have the test version in a hosting. We have a git repository and upload the files by FTP to see the changes. Thus we use a single database and not have to maintain many databases updated.
It is our solution, maybe there is a better way.
samdark
(Alexander Makarov)
December 19, 2013, 12:39pm
7
Sure there is. Check how you can deploy via git and use DB migrations to keep DB structure in repository.
kakalos12
(Kakalos12)
December 20, 2013, 1:23am
8
I wonder how to set the rule for gii when we use urlmanager?
Thanks