简体   繁体   中英

Laravel 7 XAMPP Mac OS: The stream or file “../storage/logs/laravel.log” could not be opened. Permission denied

Yes I know this question has been asked several times but I couldn't find 100% working solution yet. I have installed XAMPP from https://www.apachefriends.org and then I installed Laravel 7 using composer command composer create-project --prefer-dist laravel/laravel:^7.0 blog

Command "php artisan serve" successfully runs the project. BUT if I open the same project from URL "http://localhost/blog/public/" I get the error:

The stream or file "/Applications/XAMPP/xamppfiles/htdocs/blog/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

I cannot set folder permission to 777 because not a good approach. The permission is already "read&write". I have been following this thread.

sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache

and then

chmod -R 775 storage
chmod -R 775 bootstrap/cache

and if it won't work, try changing the 'www-data' group into '_www'.

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