Sounds like docker isn't running as the same user as the owner of the folders. What is your os?
Sail: Permission Denied
Hi, I'm setting up a new Laravel project using Sail, on Ubuntu 22.04 and am running in quite a few problems. When visiting http://localhost I am greeted with many error messages, such as:
The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
I've managed to solve this error by changing permissions on the storage folder and get to the standard Laravel homepage, but when trying to run a migration, I'm again denied permission.
file_put_contents(/var/www/html/database/migrations/2022_08_20_145015_create_users_table.php): Failed to open stream: Permission denied
I've searched through the web for solutions and found a few similar cases, but the fixes I've tried only solve part of the problem. Thank you for your help!
https://github.com/laravel/sail/issues/81
https://github.com/aschmelyun/docker-compose-laravel/issues/49
I'd like to avoid having to chmod -R 777 my whole project folder.
@Sinnbeck Well, actually I spoke too fast, realized I couldn't edit the files from the host after changing the owner to sail (obviously). I've uninstalled Docker Desktop and now everything do work fine.
Please or to participate in this conversation.