Gii 403 Error

This is my first time ever trying and installing Yii, and I followed the instructions here:

http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app

When it came time to load up Gii, I tried the URL, and I inexplicably got 403 Error message. After Googling around for a while, I found out that I had to add the ipFilters entry to the gii array in main.php. See here:


'gii'=>array(

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

			'password'=>'',

			'ipFilters'=>array($_SERVER['REMOTE_ADDR']),

		),



This fixed the problem. I tried posting a comment to the quickstart app page linked above, but I am too new to post there. I just wanted to share this in case it comes up for anyone else, but it did almost prevent me from trying out Yii, so we may want to consider adding a note about this on the tutorial page.

This way Gii will work for everyone as it uses $_SERVER[‘REMOTE_ADDR’]…

the idea behind ipFilters is to enter only your WAN IP… so that other users cannot use Gii to mess with your project…

instead of using $_SERVER[‘REMOTE_ADD’], put your computers’ ip address in there.

i.e. if your Yii installation is on a computer in your network, and you are accessing yii through a browseron a different computer on your LOCAL network (not the web), put your LOCAL ip address, i.e. 192.168.0.2, etc

that would restrict access to only your computer.

also if you computer’s local ip address changes, ie. it’s set to auto get an ip from dhcp, then be aware this may limit your ability to access the gii tool. you’ll have to edit that value in the mani config file.

i had a error 403 access denied, i searched what was wrong hier


 'ipFilters'=>array('127.0.0.1','82.80.209.67','::1'),

and i have tried this:




'modules'=>array(

        'gii'=>array(

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

            'password'=>'1234',

            'ipFilters'=>array('127.0.0.1',$_SERVER['REMOTE_ADDR'],'::1'),

        ),

    ),



now i see that i used shared ip, i had to use local ip

(cPanel show only shared ip)