Yii 403 error occurs when accessing Gii (scaffolding)

不言
Release: 2023-03-29 22:54:02
Original
1771 people have browsed it

This article mainly introduces the relevant information about the solution to the 403 error when Yii accesses Gii (scaffolding). Friends in need can refer to it

The server was configured today (win server upupw(nginx mysql )), test the Gii settings of the project, and the result is a
#403 error page:

Error 403
You are not allowed to access this page.

1. Adjusted the read and write permissions of the file and accessed it through the domain name (external network access, local access), but still reported a 403 error.
2. Then access it locally on the server (http://localhost/backend/web/index.php?r=gii) and still get error 403.
3. According to the common solution on the Internet (query the local IP: 188.33.66.88), modify backend/config/main-local.php to add the access address:

$config['modules' ]['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1', '::1','188.33. 66.88'],
];

Still not solved, still reporting 403 error.

Because the virtual host made by nginx is used locally and the domain name is directly bound for access, it is directly migrated to the local server, bound 127.0.0.1 and localhost, and then accesses http://localhost/backend/web/ locally again. index.php?r=gii, the gii management interface appears.

The above is the detailed content of Yii 403 error occurs when accessing Gii (scaffolding). For more information, please follow other related articles on the PHP Chinese website!

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!