Recently I made an account in AWS. I'm using their EC2 with Ubuntu. I installed my Laravel project and in the command-line wrote chmod -R 777 storage
. Now i'm getting an error:
ErrorException in Filesystem.php line 81: file_put_contents(/var/www/html/BlueDrive/bluedrive/drive/bootstrap/cache/services.json): failed to open stream: Permission denied
What should I do to prevent this exception?
go to the root of your project and
cd into the bootstrap directory. and issue chmod -R 777 .
Remember the storage directory is different from the bootstrap directory.
Laravel create a file name services.json inside boostrap/cache to list all your service providers in your application. laravel will need permission to do so that is why you are seeing that error.
This is an access permission problem.
Run the following command:
$ sudo chown nobody /var/www/html/BlueDrive/bluedrive/drive/bootstrap/
$ sudo chmod -R 0755 /var/www/html/BlueDrive/bluedrive/drive/bootstrap/
OR
run
chmod -R 777 /path/to/the/folder