站长资讯网
最全最丰富的资讯网站

为什么laravel框架报403错误

在laravel中,因为配置解析时项目根目录没有指向public目录,所以会出现项目报403错误;只需在项目目录中将运行目录或根目录的路径设置为public目录即可解决报403错误。

为什么laravel框架报403错误

本文操作环境:Windows10系统、Laravel6版、Dell G3电脑。

为什么laravel框架报403错误

原因:项目根目录没有指向public目录,

配置解析的时候忘记指定public目录了

为什么laravel框架报403错误

最大可能是你的网站根目录没有设置为public

在网站配置设置一下就好

为什么laravel框架报403错误

为什么laravel框架报403错误

扩展知识:

在vhost.conf中创建一个虚拟主机,根目录是laveral的public目录

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

赞(0)
分享到: 更多 (0)