Changing default file permissions for files created by PHP

风流意气都作罢 提交于 2019-12-25 04:01:39

问题


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).

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

Many thanks!


回答1:


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

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.



来源:https://stackoverflow.com/questions/12672815/changing-default-file-permissions-for-files-created-by-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!