我试图在YII中使用GII功能,但当我打开GII页面时,它会给我错误


I am trying to use GII feature in YII, but it gives me error when I am opening the gii page

显示错误。

错误403您不允许访问此页。

我在保护目录下的main.php文件中取消了注释。

'gii'=>array(
        'class'=>'system.gii.GiiModule',
        'password'=>'admin',
        // If removed, Gii defaults to localhost only. Edit carefully to taste.
        'ipFilters'=>array('127.0.0.1','::1'),
    ),

请帮。

这是你的问题的解决方案:

http://www.yiiframework.com/wiki/115/why - -我得到一个- 403错误——当——努力——使用——gii/

你需要把你的ip地址添加到'ipFilters'数组

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

您是否使用localhost访问gii ?您是否能够使用localhost访问本地web服务器?如果您没有将127.0.0.1映射到localhost,则无法通过使用localhost访问您的web服务器,这在大多数情况下是默认的,这取决于您的系统和您安装php / apache的方式

'ipFilters'=>array('127.0.0.1','*.*.*.*')

,然后将其关闭或更改回来…

因为如果你不……孩子们会带你下来