Reputation: 135
When i access view in my laravel application, why is it always showed this error every 1 minute:
file_put_contents(/home/vagrant/Code/myproject/storage/framework/cache/data/db/59/db59a863cb50aaccca0c973c049bd67971a7e3ae): failed to open stream: Permission denied
?
When i run chmod -R 777 storage/
, that'll work, but then it keep changing permission every 1 minute.
Even though I do:
php artisan config:cache
php artisan cache:clear
php artisan view:clear
php artisan clear-compiled
in my local machine, didn't work for me.
I'm using:
Please help. Thank you for any answer.
Upvotes: 1
Views: 2905
Reputation: 727
I tried the following and it somehow works for me:
sudo nano /etc/php/7.2/fpm/pool.d/www.conf
Change the following paramaters:
user = www-data
group = www-data
To:
user = vagrant
group = vagrant
Remember to restart PHP FPM
sudo service php7.2-fpm restart
Upvotes: 1
Reputation: 2762
Change the owner of the whole project with chown
. Set the new owner www-data
.
sudo chown -R www-data:www-data /var/www
Upvotes: 2