Home >PHP Framework >Laravel >Why does the laravel framework report a 403 error?
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.
#The operating environment of this article: Windows 10 system, Laravel version 6, Dell G3 computer.
Cause: The project root directory does not point to the public directory,
I forgot to specify the public directory when configuring parsing
The most likely reason is that your website root directory is not set to public
Just set it in the website configuration
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!