雷林鹏分享:Yii(yiiframework)框架(三):gii页面出现403错误的解决方法

  把yii框架和应用搭建好了,测试了一下gii页面,竟然出现了403错误

  Error 403

  You are not allowed to access this page.

  出现这个问题的原因是:YII为了安全考虑,只允许本机访问gii页面,这里我们可以从配置文件protected/config/main.php中看出来:

  'modules'=>array(

  // uncomment the following to enable the Gii tool

  'gii'=>array(

  'class'=>'system.gii.GiiModule',

  'password'=>'111',

  // If removed, Gii defaults to localhost only. Edit carefully to taste.

  'ipFilters'=>array('127.0.0.1','::1'),

  ),

  ),

  为了让自己的计算机可以访问gii页面,需要对配置文件进行修改:

  'ipFilters'=>array('127.0.0.1','192.168.23.1','::1'),

  加入自己计算机的IP地址。然后再次访问访问gii页面,即可。

  文章转载自 [http://www.php230.com](编辑:雷林鹏 来源:网络 侵删)

posted @ 2019-05-20 15:48  lei林鹏  阅读(273)  评论(0编辑  收藏  举报