Home  >  Article  >  PHP Framework  >  Why does the laravel framework report a 403 error?

Why does the laravel framework report a 403 error?

WBOY
WBOYOriginal
2022-06-07 15:50:022995browse

In laravel, because the project root directory does not point to the public directory during configuration parsing, a 403 error will appear in the project; just set the path of the running directory or root directory to the public directory in the project directory. Solve the problem of 403 error.

Why does the laravel framework report a 403 error?

#The operating environment of this article: Windows 10 system, Laravel version 6, Dell G3 computer.

Why does laravel framework report a 403 error

Cause: The project root directory does not point to the public directory,

I forgot to specify the public directory when configuring parsing

Why does the laravel framework report a 403 error?

The most likely reason is that your website root directory is not set to public

Just set it in the website configuration

Why does the laravel framework report a 403 error?

Why does the laravel framework report a 403 error?

Extended knowledge:

Create a virtual host in vhost.conf, the root directory is the laveral public directory

<VirtualHost *:80>
     ServerName laravelht.vn
     DocumentRoot  C:/phpStudy/PHPTutorial/WWW/asd/laravel/public
     SetEnv APPLICATION_ENV "development"
     <Directory C:/phpStudy/PHPTutorial/WWW/asd/laravel/public>
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
         Order allow,deny
         Allow from all
     </Directory>
 </VirtualHost>

[Related recommendations: laravel video tutorial

The above is the detailed content of Why does the laravel framework report a 403 error?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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