PHP mkdir and apache ownership

后端 未结 4 1355
南方客
南方客 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 08:28

    Safe_mode is turn on on your server. The function mkdir() creates folder with owner ("apache", "none", ..) that different of the current script owner. And scripts couldn't upload (move, copy) files into that folder with another owner (that is not like current script owner).

    Disable safe_mode and that would be work.

    See http://php.net/manual/en/features.safe-mode.php for details.

    P.S. With enable safe_mode you can't use chmod() function in php.

提交回复
热议问题