followed instructions for creating crud operations in "Creating First Yii Application" tutorial, ran index.php?r=gii and got 403 error: "You are not allowed to access this page" from Gii Error generator.
Any ideas?
thanks
followed instructions for creating crud operations in "Creating First Yii Application" tutorial, ran index.php?r=gii and got 403 error: "You are not allowed to access this page" from Gii Error generator.
Any ideas?
thanks
You should login the site first, maybe.
I never had this kind of error, so I am just guessing.
there’s a password set up in protected/config/main.php and according to the tutorial i should be prompt for entering it but i don’t.
if you are trying generate models from another server than local,
you must complete your IP addres from which you run the script, by add
‘ipFilters’=>array(‘your_IP_addr’)
like:
return array(
'modules'=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'wprowadź tutaj hasło',
'ipFilters'=>array('123.123.123.123'),
// 'newFileMode'=>0666,
// 'newDirMode'=>0777,
),
),
);
Hi, all. I have the same problem on Ubuntu server. I modified the main.php file and I added ipFilter with the IP address. But gii generation code still shows the same error:
Error 403
"You are not allowed to access this page"
Any ideas?
Thanks in advance.
You must know the ip address that your are using to access your app:
'modules'=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'**************************',
'ipFilters'=>array('200.*','189.*','127.*'),
),
),
Hi, Flavio. I appreciate your time to reply Gii error. Thanks, I did that you write and it is working properly.
Cheers
Monico
‘gii’=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123456',
'ipFilters'=>array('10.0.0.124'),
),
‘db’=>array(
'connectionString' => 'mysql:host=localhost;dbname=myyii',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
Hi Guys,
I am using the above configuration, and the page gets blank?
Help me out, Please.
Thanks in advance.
Got the solution…
Thanks
@Flavio: Great!!
I just needed to add the ‘ipFilter’ property with my local LAN and it worked like a charm.
'ipFilters'=>array('192.168.0.*','127.*')
PS: No need to login first. It will ask for the pass you configured in main.php
Thx!
I use linode.com and use their lish terminal to access my server. I tried the IP address of my machine, I tried the IP address of my server, I wild carded the only way I can get GII to work is if I mask ... how can I tell what IP address Yii sees me as?
I added my IP but still wasn’t working, so I did ‘ipFilters’=>array(’*’), done generating stuff and changed back to specific IP…
Adding IpFilters did’n work for me using localhost/myproject/web/index.php/gii.
The solution is you have to use 127.0.0.1/myproject/web/index.php/gii
So:
'gii' => array(
'class' => 'system.gii.GiiModule',
'generatorPaths' => array('vendor.itnow.yii-gii-template.src.gii'),
'ipFilters' => array('127.0.0.1', '10.0.2.2', '192.168.56.1')
'ipFilters'=>array('*')
),
works for 127.0.0.1/myproject/web/index.php/gii