Apache PHP - 默认上传文件权限

Apache PHP - default upload file rights

我希望默认将上传的文件权限设置为 rw-r--r-- 但有 rw-r----- (缺少其他人的读取权限...)。

  1. 文件通过php上传。所有 umask 都已设置为 022。

    根目录 0022 diradmin mysql majordomo webapps dovecot admin 0022 fw 0022

  2. 基本目录权限为 777

    [root@server1 library]#getfacl images 文件:图像 拥有者:fw 组: fw user::rwx group::rwx other::rwx

  3. touch 命令让我得到我想要的 (rw-r--r--)。

但是当通过网站 (php) 上传文件时,文件权限被设置为 rw-r-----。我需要其他人的阅读权限。

为了这个问题纠结了几天。我不确定 directadmin 是否涉及此问题。 任何人请建议。

也许你上传后移动文件时可以使用chmod来更改就可以了

the doc here