Home > php, webframework, yii > Fix gii 403 Error in yii

Fix gii 403 Error in yii

This labor day weekend I’ve been learning yii – a php framework by reading the recently published Agile Web Application Development with Yii1.1 and PHP5. While trying to get the gii code generator working I got stuck somehow by a 403 error. Googling around and all solutions talk about adding the following bold line

return array(
            'ipFilters'=>array(...a list of IPs...), // ***

to the main configuration file. A bit configuration info about my server set: server is a headless sheevaplug with Ubuntu 9.04 with php 5.2, yii 1.1.4 (just released this weekend). Server ip is and the web client’s ip (where I am trying to access gii) is I added to the ipFilters array but still didn’t work. A bit more googling points me to http://www.yiiframework.com/forum/index.php?/topic/10269-gii-403-forbidden/ and I added
to top of the main index.php file and I saw this line:


This explains why adding didn’t work, it seems my sheevaplug recognizes the remote client’s ip in ipv6 format and after adding the above string to ipFilters array the problem was solved.

Categories: php, webframework, yii
  1. Jersey
    September 11, 2010 at 2:35 am

    Thank you! Had that issue and this fixed it right away.

  2. pba
    October 25, 2010 at 2:08 pm

    In my case it was ipv4 address but it didn’t work as well. Now it does :)

  3. November 17, 2010 at 10:05 am

    That hint just came handy. Was already tended to take the framework apart for looking at that :)

  4. camden-kid
    April 13, 2012 at 4:05 pm


  1. September 11, 2010 at 6:32 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: