chmod 777 in php

前端 未结 4 1019
无人共我
无人共我 2021-01-14 15:11

If I create a folder in php with mkdir() it has the www-data : www-data user and 755 permissions.

The problem is I can\'t delete this folder with the ftp-user (zapbe

4条回答
  •  清歌不尽
    2021-01-14 15:46

    In order to remove a directory, you need to have write permissions on the parent directory, not on the one you want to remove. In order to provide write access on the parent, a good approach would be to make that parent owned by some group that both www-data and your ftp user are members of, and never use the 777 permissioning. Also, make sure your parent folder does not have the sticky bit set.

提交回复
热议问题