The permissions for the storage
and vendor
folders should stay at 775
, for obvious security reasons.
However, both your computer and your server Apache need to be able to write in these folders. Ex: when you run commands like php artisan
, your computer needs to write in the logs file in storage
.
All you need to do is to give ownership of the folders to Apache :
sudo chown www-data:www-data /path/to/your/project/vendor
sudo chown www-data:www-data /path/to/your/project/storage
Then you need to add your computer (referenced by it's username
) to the group to which the server Apache belongs. Like so :
sudo usermod -a -G www-data userName
Most frequently, groupName
is www-data
but you might want to replace it with your correct group.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…