I'm having a problem on my Ubuntu 14.04 and my Laravel 5.1 app.
I'm getting this error when my app wants to log:
Uncaught UnexpectedValueException: The stream or file storage/logs/l could not be opened: failed to open stream: Permission denied in /var/www/releases/20160426/booking_server/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87\nStack trace:\n#0........it continues
I have found this solution:
sudo php artisan cache:clear
sudo chmod -R 777 storage
sudo composer dump-autoload
But the problem is that its just temporarily. The problem comes back everyday and I always have to do the same.
What can I do to stop this happening everyday?
PD: I have a daily log, but if its possible I want to keep it this way.