Daniele Corti - 2019-09-20 03:02:59
Hi,
In the documentation on laravel.com, is suggested to give the write permissions only to storage and the bootstrap/cache directories.
About the command to do this, I think is better:
cd PATH/TO/YOUR/WEBSITE/
sudo chmod -R 555 ./
sudo chmod -R 776 ./storage
sudo chmod -R 776 ./bootstrap/cache
(remember to add the dot before /)
Another thing: if you are on an hosting provider, usually, all the operation are performed by the same user which run the PHP instance, so adding file and installing through composer set the right ownership.
But, if you are using a dedicated webserver for you laravel app, you should check the user and group owner of the files.
Depending on you distribution, you should check if the user and group are correct.
Usually apache run over:
- RedHat based distro: apache:apache
- Debian based distro: www-data:www-data
While ngnix run over:
- RedHat based distro: ngnix:ngnix
- Debian based distro: www-data:www-data (not sure about this)
Hope this helps