dongxuan1314
2008-08-14 13:22
浏览 102
已采纳

使用PHP / Apache上传文件夹的适当权限是什么?

Sorry for the basic question - I'm a .NET developer and don't have much experience with LAMP setups.

I have a PHP site that will allow uploads to a specific folder. I have been told that this folder needs to be owned by the webserver user for the upload process to work, so I created the folder and then set permissions as such:

chown apache:apache -R uploads/
chmod 755 -R uploads/

The only problem now is that the FTP user can not modify the uploaded files at all.

Is there a permission setting that will allow me to still upload files and then modify them later as a user other than the webserver user?

图片转代码服务由CSDN问答提供 功能建议

对不起基本问题 - 我是.NET开发人员,对LAMP设置没有太多经验。

我有一个PHP站点,允许上传到特定文件夹。 我被告知该文件夹需要由webserver用户拥有才能使上传过程正常工作,因此我创建了该文件夹,然后设置权限:

  chown apache  :apache -R uploads / 
chmod 755 -R uploads / 
   
 
 

现在唯一的问题是FTP用户根本无法修改上传的文件。

是否有权限设置允许我仍然上传文件,然后以网络服务器用户以外的用户进行修改?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

8条回答 默认 最新

  • douxuanwei1980 2008-08-14 13:32
    已采纳

    You can create a new group with both the apache user and FTP user as members and then make the permission on the upload folder 775. This should give both the apache and FTP users the ability to write to the files in the folder but keep everyone else from modifying them.

    评论
    解决 无用
    打赏 举报
查看更多回答(7条)

相关推荐 更多相似问题