Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

williamvicary's avatar

boostrap/cache Permissions require custom hook

I've just got started with Envoyer (which is great by the way!) and I've noticed a quirk with Laravel 5.1 based on a requirement change.

Envoyer publishes Laravel projects using default chmod settings (which makes sense) however the new requirement for bootstrap/cache to be writable (I needed 777 oddly 666 didn't cut it) isn't performed by Envoyer at the moment.

I've added in a custom hook after "Activate New Release" with something similar to: chmod -R 777 /var/www/my_project/current/bootstrap/cache

But it just seems like this should be something that Envoyer handles for you, and I presume is a bug?

0 likes
2 replies
trevorg's avatar

I also added a hook like this to CHMOD the cache directory. I think whether this is necessary depends on the specifics of your installation.

However, you shouldn't need 777. In my case I use 775. I created a user envoyer in the www-data group, so that all the files Envoyer creates have the ownership of envoyer:www-data and the webserver then can read and execute everything (since it's in the www-data group). Then my hook makes it so the group www-data can also write to the cache directory, which it needs to do.

The only other thing I did ahead of time was give the same permissions to the storage directory.

I'm not 100% sure this is the best way to do it, but I think it's safer than the alternatives. I would be happy to know what others are doing.

1 like
benxmy@gmail.com's avatar

FYI - I found the 755 permissions didn't work. Ultimately, the following ended up working (provided the deployment user's primary group is www-data):

  • sudo chmod -R ug+rwx bootstrap/cache

Please or to participate in this conversation.