Home  >  Article  >  php教程  >  Yii 访问 Gii(脚手架)时出现 403 错误

Yii 访问 Gii(脚手架)时出现 403 错误

WBOY
WBOYOriginal
2016-06-13 10:56:20884browse

    今天配置好了虚拟机服务器内的 Yii framework v1.1.3,测试项目的Gii设置,
 

    结果出现#403错误页面:
    Error 403
    You are not allowed to access this page.

    开始误以为是文件授权不足的原因,修改文件和文件夹授权后,依然如故。查官网上的wiki发现,原来是yii为了安全考虑,默认只允许在本机上访问Gii。

    解决此问题,修改配置如下:

      'modules' => array(
        'gii' => array(
          'class' => 'system.gii.GiiModule',
          'password' => 'password',
          'ipFilters' => array('10.0.0.119'),
        ),
      )

    修改其中的ipFilters定义,把工作机的IP加入允许访问列表中,即

    'ipFilters' => array('10.0.0.119')

    终于可以在工作机上正常访问Gii了。
 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn