laravel – The stream or file “/storage/logs/laravel.log” could not be opened in append mode: failed to open stream: Permission denied

Posted by

Error:

The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: 
Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file 
"/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: 
Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" 
could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: 
The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" 
could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/opt/lampp/htdocs/myhospitalnow/mhn-core/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: Target class [PagesController] does not exist. Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: 
{"exception":{}} Context: {"exception":{}} Context: {"exception":{}}

Solution:

What I have tried so far is to allow access to storage via:

Step 1:

sudo chmod -R 775 storage

Step 2: Go to your project and this command

chown -R daemon:daemon .

After that problem solved

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x