I am new in yii framework. In my site gii shows the error
Error 403 You are not allowed to access this page.
I set the gii in the config file like this
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'test123',
'ipFilters'=>array('192.168.0.101','127.0.0.1','::1'),
),
still it show the error
Why do I get a 403 error when trying to use Gii?
If the above link does not help any, try to lookout appplication.log file in runtime folder to see what is going wrong.
Consider where your development server is located (same maching, LAN, WAN) and how your IP address changes towards the server.
If your server is running on the same machine as does your client (the browser), you request the page from the localhost itself, thus your IP address is 127.0.0.1 and the default settings work.
If your server is on a different machine but in your local area network (LAN), your IP address would typically look something like this 192.168.1.20 for the server. You can find it and adjust the code.
If your server is across the web (WAN), then you would either have a
Only if the very last (unpredictable dynamic IP address) is the case, I would follow this answer by schmunk who also points out the risk.
Using
$_SERVER['REMOTE_ADDR']
seems unnecessary to me.After replace it by using this default code,
and user this url.
http://localhost/basic/web/index.php?r=gii
I had a very similar problem. For me it was that my user account didn't have writeaccess to my PHP session_save_path folder. When I browsed to it in Windows 7, it told me I needed permission and it would grant it if I chose OK. I did. Everything was fixed.
try this