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 / 



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

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.

    解决 无用
    打赏 举报

相关推荐 更多相似问题