-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied #149
Comments
Hi there, Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels: However, this issue will not be locked and everyone is still free to discuss solutions to your problem! Thanks. |
Can you give me any hint why this error shows? "The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied " |
@princerafid01 have the same issue, |
@Kladislav Thank you. It didn't work for me though. |
This actually looks like a bug, not a misusage. When running docker in root-less mode, the root user in the container maps to your personal user, and the volume will map with root permissions and ownerships also. But sail creates its own user in the container and runs Laravel with that specific user, resulting in not having access to the project folders. I tried to fix that by publishing Dockerfiles and editing them so that Laravel gets runned as root, but it still cripples the |
Ran to this problem today. Some notable remarks:
|
Maybe this should get reopened? |
@zaimazhar97, this container uses once only for install composer requirements with |
Go to container shell I saw in vendor/laravel/sail/runtimes/8.0/Dockerfile the user is sail |
Hi, I've been struggling with the same problem again for the past few days too and I would like to share some possible solutions;
I don't know which step solved the problem for me but this is what I did, in sequence. It might not be the ideal or conventional solution for everyone but it is worth a try. |
I've problem with this too. I think supervisord [program:php] should change into variable like this
|
Could someone tell me which project provides the docker-compose.yml and Dockerfile for this? I just tried to set up my first Laraval project to learn it... so I have no clue on where this configuration comes from if it isn't from this project. |
I'm not sure if this applies to you, but for me this was a permission issue. Meaning that the owner of the files in your sail folder and the owner inside your docker container don't align. Easiest way to confirm is to echo $UID and see the files/folders inside your container have the same user:group. If not, you should update your |
Just had this same problem because i started the app using docker desktop. I then stopped it and started it using sail and the permission problem went away! |
Description:
After Installing Sail my app runs on http://localhost but it shows "The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied ". And my localhost user and docker user is also different. I am running docker in rootless mode. How to prevent this error?
The text was updated successfully, but these errors were encountered: