简体   繁体   中英

Laravel getting 403 Forbidden error “You don't have permission to access this resource.”

i am working on a Laravel project in MAMP environment.

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

And if i moved Laravel project to

/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. 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. Anything i missed out?

in /etc/apache2/httpd.conf add this

<Directory "/desktopFolderPath"> // here your dir path
            AllowOverride All
            Require all granted
</Directory>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM