---
title: "yii-You are not allowed to access this page"
author: "csstome"
date: "2011-05-08T11:45:00Z"
tags: []
slug: "yii-you-are-not-allowed-to-access-this-page"
draft: false
lastmod: "2011-10-28T08:48:02Z"
id: 1219533
url: "https://csstome.iteye.com/blog/1219533"
---

## yii-You are not allowed to access this page

Error 403  
You are not allowed to access this page.

问题分析：yii处于安全考虑。默认情况下允许在本机运行gii组件。所以出现上述问题，一般都是服务器不是本机。

解决方法：编辑你的main.php配置文件

‘modules’=&gt;array(  
‘gii’=&gt;array(  
‘class’=&gt;’system.gii.GiiModule’,  
‘password’=&gt;’password’,  
‘ipFilters’=&gt;array(‘127.0.0.1′,’::1′), //将此处的IP改为本机目前使用的IP  
),  
),

在ipFilters中设置你的本机IP （记住是你本机 客户端ip 而不是服务端ip）