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'), ), ),
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'),
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)!