User group settings for nginx + php environment under linux
学习ing
学习ing 2017-06-21 10:11:19
0
2
876

question

My server is from Alibaba Cloud. The default website directory is the newly created www directory. In this directory, the user and group are root, and the permissions are 755. At this time, when running php, writing operations cannot be performed in the directory. It has to be 777. Personally, I have set the user of the directory that needs to be written to www, and the group is still root, so that the writing operation can be performed. The users and groups to which nginx and php-fpm belong are both www. Do you have any good suggestions for permission settings for directory groups?

学习ing
学习ing

reply all(2)
我想大声告诉你

It is recommended to set the www directory to www:www and then set the permissions to 755

小葫芦

Writing to a directory originally requires 7, so 777 is no problem. You wouldn’t set all directories to 777, but only set the directories that require write permission to 777.
@Samuelren It is recommended that the www directory be set to www:www and then the permissions be set to 755. This is obviously not possible, because it is equivalent to 7 for the entire directory.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template