Laravel Sail - The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode
Description:
When a root user in WSL Ubuntu runs the command "./vendor/bin/sail up", docker creates a container but the generated Laravel web page displays the following error message:
The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied
Possible solution:
Run as a non-root user.
Reference:
https://medium.com/redbubble/running-a-docker-container-as-a-non-root-user-7d2e00f8ee15
Subscribe to my newsletter
Read articles from Mohamad Mahmood directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Mohamad Mahmood
Mohamad Mahmood
Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He studies at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).