Ad

Laravel Error Message

- 1 answer

Does anyone have any idea what this error message relates to and how I can resolve it;

file_put_contents(/var/www/myproject/bootstrap/cache/services.php): failed to open stream: Permission denied

This happens very often, sometimes when I add a new provider or when I run composer update

Ad

Answer

As nzt has stated it is a permissions issue.

So if you had originally set the permission correctly on that directory and have this issue, more than likely the reason for this is when you run those CLI commands (artisan, composer) you are running them as a different user than the web server uses. If that file gets recreated after you have ran one of those, it wont have the correct permissions for the web server to write to it any more.

Ad
source: stackoverflow.com
Ad