Home > php教程 > PHP开发 > Yii (yiiframework) framework (3): Solution to 403 error on gii page

Yii (yiiframework) framework (3): Solution to 403 error on gii page

黄舟
Release: 2016-12-27 10:55:55
Original
1313 people have browsed it

After setting up the yii framework and application, I tested the gii page, and a 403 error occurred

Error 403
You are not allowed to access this page.
This problem occurred The reason is: For security reasons, YII only allows the local computer to access the gii page. Here we can see from the configuration file 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'),
	),
 
),
Copy after login

In order to allow your computer to access the gii page, The configuration file needs to be modified:

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

Add the IP address of your computer. Then visit the gii page again.

The above is the Yii (yiiframework) framework (3): the solution to the 403 error on the gii page. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template