4

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
  • 9,373
  • 64
  • 206
  • 383

2 Answers2

19

Navigate to the project directory and run

sudo chmod -R 777 storage/*
Victor Ejiogu
  • 1,082
  • 14
  • 22
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
  • 4,696
  • 3
  • 20
  • 25