Yii Framework Forum: Gii 403 Error - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Gii 403 Error Rate Topic: -----

#1 User is offline   mattsilv 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 23-November 10
  • Location:NYC

Posted 23 November 2010 - 02:54 PM

This is my first time ever trying and installing Yii, and I followed the instructions here:
http://www.yiiframew...start.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.
Managing Partner, Co-Founder, Nutritionix
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,359
  • Joined: 12-October 09
  • Location:Croatia

Posted 24 November 2010 - 03:51 AM

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...
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   SteveWa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 14-January 11

Posted 14 January 2011 - 02:22 PM

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.
0

#4 User is offline   arthur5555 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 21-February 13

Posted 21 February 2013 - 09:10 AM

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)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users