更改PHP创建的文件的默认文件权限 [英] Changing default file permissions for files created by PHP

查看:124
本文介绍了更改PHP创建的文件的默认文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台具有多个用户帐户的Amazon EC2服务器.每个用户都安装了一个基于PHP的CMS系统,该系统在安装过程中会从远程存储库中下载一些软件包.问题是下载的软件包对用户而言不可写(即无法删除).

I have an Amazon EC2 server with multiple user accounts. Each user installs a PHP-based CMS system which during the install process downloads a few packages from a remote repository. The problem is that downloaded packages are not writable for the user (ei. cannot be deleted).

问题是,如何将PHP创建的文件的默认文件权限设置为666?

Question is, how can I set the default file permission for files created by PHP to 666?

非常感谢!

推荐答案

您可以使用find查找apache拥有的所有文件,然后以所需的权限chmod查找它们.

You can use find to find all of the files that are owned by apache and then chmod them with the desired permissions.

例如:
find <your direcoty path> -type f -user "apache" -exec chmod 666 {} \;
将递归地更改指定路径中apache拥有的所有文件的权限.

For example:
find <your direcoty path> -type f -user "apache" -exec chmod 666 {} \;
will change the permissions of all files owned by apache in the specified path recursively.

在搜索网络时,我发现

While I was searching the web I found this answer, which I think, is a more proper way to handle your problem.

这篇关于更改PHP创建的文件的默认文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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