PHP mkdir and apache ownership

后端 未结 4 1354
南方客
南方客 2020-12-19 07:42

Is there a way to set php running under apache to create folders with the folder owned by the owner of the program that creates it instead of being owned by apache?

4条回答
  •  醉酒成梦
    2020-12-19 08:39

    Not directly, no. You can't "give away" ownership of a file to another user, unless you're root. You could investigate using the "AssignUserID" apache directive to force that particular vhost to run as a particular user/group. With that Apache/PHP would create any files with the appropriate ownership

提交回复
热议问题