PHP文件和目录的chOwner和组权限

时间:2021-07-13 16:41:26

What user and group ownership should I set for php files and directories that not need to written to?

我应该为不需要写入的php文件和目录设置什么用户和组所有权?

The root user OR the user that web server is running as?

root用户或Web服务器正在运行的用户?

Is it a good idea to set chown root:$USER * for these files and folders?

为这些文件和文件夹设置chown root:$ USER *是一个好主意吗?

1 个解决方案

#1


0  

as the ideal way is to set 644 permission to all files and 755 permission to all folders. for that you can use following command.

因为理想的方法是为所有文件设置644权限,为所有文件夹设置755权限。为此你可以使用以下命令。

chmod 755 $(find /path/to/base/dir -type d)
chmod 644 $(find /path/to/base/dir -type f)


Hope it helps.

希望能帮助到你。

Thank you.

#1


0  

as the ideal way is to set 644 permission to all files and 755 permission to all folders. for that you can use following command.

因为理想的方法是为所有文件设置644权限,为所有文件夹设置755权限。为此你可以使用以下命令。

chmod 755 $(find /path/to/base/dir -type d)
chmod 644 $(find /path/to/base/dir -type f)


Hope it helps.

希望能帮助到你。

Thank you.