简体   繁体   English

Laravel 收到 403 Forbidden 错误“您无权访问此资源。”

[英]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.confDocumentRoot<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.

相关问题 我将我的 Laravel 项目部署到 Heroku 但 git 这个 403 错误“禁止您无权访问此资源”。 - I deployed my Laravel project into Heroku but git this 403 error “Forbidden You don't have permission to access this resource.” AWS Elastic Bean Stalk,错误 403 Forbidden “您无权访问此资源。” - AWS Elastic Bean Stalk, Error 403 Forbidden “You don't have permission to access this resource.” 您无权访问此资源。 此外,遇到了 403 Forbidden 错误 - You don't have permission to access this resource. Additionally, a 403 Forbidden error was encountered 得到“禁止您无权访问此资源。 ” 对于特定路线 - getting “Forbidden You don't have permission to access this resource. ” for a particular route (403) 禁止。 您无权访问此资源 - (403) Forbidden. You don't have permission to access this resource 403 Forbidden 您无权访问此资源 - 403 Forbidden You don't have permission to access this resource 禁止您无权访问此资源。 .htaccess 未重定向请求 - Forbidden You don't have permission to access this resource. .htaccess is not redirecting requests WORDPRESS 403 禁止。 您无权访问此资源 - WORDPRESS 403 Forbidden. You don't have permission to access this resource PHPS 源文件 - 403 Forbidden 您无权访问此资源 - PHPS source file - 403 Forbidden You don't have permission to access this resource 403禁止访问:您无权访问 - 403 Forbidden : You don't have permission to access
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM