gii error

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?


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



return array(




        'password'=>'wprowadź tutaj hasło',


        // '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:








Hi, Flavio. I appreciate your time to reply Gii error. Thanks, I did that you write and it is working properly.









		'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…


@Flavio: Great!!

I just needed to add the ‘ipFilter’ property with my local LAN and it worked like a charm.


PS: No need to login first. It will ask for the pass you configured in main.php

Thx! :)

I use 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


            'gii' => array(

                'class' => 'system.gii.GiiModule',

                'generatorPaths' => array('vendor.itnow.yii-gii-template.src.gii'),

                'ipFilters' => array('', '', '')



works for