[英]Laravel getting 403 Forbidden error “You don't have permission to access this resource.”
i am working on a Laravel project in MAMP environment.我正在 MAMP 环境中从事 Laravel 项目。
Basically, if i created Laravel project in基本上,如果我在
/User/my-user/Desktop/myLaravelProj
when i go http://localhost, browser shows me 403 Forbidden error "You don't have permission to access this resource."当我访问 http://localhost 时,浏览器显示 403 Forbidden 错误“您无权访问此资源。”
And if i moved Laravel project to如果我将 Laravel 项目移动到
/Users/my-user/.composer/vendor/laravel/installer/myLaravelProj or /Library/WebServer/Documents/myLaravelProj
It works fine.它工作正常。
I've changed /etc/apache2/httpd.conf
's DocumentRoot
and <Directory>
to corresponding-directory/myLaravelProj/public
when i moved my project folder around.当我移动我的项目文件夹时,我已将
/etc/apache2/httpd.conf
的DocumentRoot
和<Directory>
更改为corresponding-directory/myLaravelProj/public
。 I also granted permission for directories storage and bootstrap/cache by我还通过以下方式授予了目录存储和引导程序/缓存的权限
sudo chmod -R 775 storage/ bootstrap/cache/
sudo chown -R my-user:www storage/ bootstrap/cache/
I like to have my Laravel project in Desktop for quicker access.我喜欢在桌面上有我的 Laravel 项目以便更快地访问。 Anything i missed out?
我错过了什么吗?
in /etc/apache2/httpd.conf
add this在
/etc/apache2/httpd.conf
添加这个
<Directory "/desktopFolderPath"> // here your dir path
AllowOverride All
Require all granted
</Directory>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.