5

I am trying to run an existing Laravel project on my localhost but when I try to run the dam thing I get this error:

The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

I have tried the following:

chmod -R 775 storage and chmod -R 777 storage

Still nothing, I have even tried to do chgrp -R www-data my-project and I get this error in terminal

chgrp: www-data: illegal group name

What am I doing wrong?

user979331
  • 11,039
  • 73
  • 223
  • 418

2 Answers2

21

Navigate to the project directory and run

sudo chmod -R 777 storage/*
Victor Ejiogu
  • 1,184
  • 14
  • 23
6

This is my solution.

First you need to run php artisan cache:clear from the project directory, then chmod -R 777 app/storage and finally composer dump-autoload and now it will be working fine..

illegal group name actually means that the group you're specifying(after www-data going username).You need to either create the group, stop specifying a group, or specify a group that exists.

Ismoil Shifoev
  • 5,512
  • 3
  • 24
  • 32