什么是用PHP / Apache的上传文件夹的适当的权限? [英] What are the proper permissions for an upload folder with PHP/Apache?

查看:210
本文介绍了什么是用PHP / Apache的上传文件夹的适当的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉的基本问题 - 我是一个.NET开发人员,并且没有用LAMP设置了丰富的经验。

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

我有一个PHP网站,将允许上传到特定的文件夹中。有人告诉我,这个文件夹必须由上传过程的工作网络服务器用户所拥有,所以我创建的文件夹,然后设置权限这样:

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/

唯一的问题是现在的FTP用户不能修改上传的文件都没有。

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

是否有权限设置,让我仍然上传文件,然后再修改它们比web服务器的用户?

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?

推荐答案

您可以创建一个新组既apache用户和FTP用户成为会员,然后就上传文件夹775允许这应该给这两个阿帕奇和FTP用户写入到文件夹中的文件,但保留其他人对其进行修改的能力。

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.

这篇关于什么是用PHP / Apache的上传文件夹的适当的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆