'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.
Solution 1:[1]
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'.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gonras Karols |
