duanpen9294 2010-04-01 13:45 采纳率: 100%
浏览 53
已采纳

PHP mkdir和apache所有权

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?

Using word press it creates new folders to upload into but these are owned by apache.apache and not by the site that they are running in. This also happens using ostickets. For now we have to SSH into the server and chmod the folder, but it would seem there would be a setting somewhere to override the ownership outside of any program that does it.

  • 写回答

4条回答 默认 最新

  • dqkelut8423 2010-04-07 16:38
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?