简体   繁体   English

CENTOS上的Apache许可

[英]Permission with Apache on CENTOS

I installed LAMP in my CENTOS and it all looks fine. 我在CENTOS中安装了LAMP,看起来一切正常。 In my www/html/ folder I placed my script and they all work fine, they can write/read everything. 在我的www / html /文件夹中,放置了脚本,它们都可以正常工作,它们可以编写/读取所有内容。 However everytime I create a folder and I put files inside it they cannot write, for example, if I use file_put_contents with PHP it does not work due the permission denied error. 但是,每次创建文件夹并将文件放入其中时,它们都无法写入,例如,如果我将file_put_contents与PHP配合使用,则由于权限被拒绝错误而无法正常工作。

Everytime it happens I need to chmod 777 to that folder and all the files inside. 每当发生这种情况时,我都需要将chmod 777更改为该文件夹以及其中的所有文件。 It's a great time loss. 这是一个巨大的时间损失。

Is there someway I configure the CENTOS so everytime I create a folder or upload a file it automatically will have read/write permission? 是否以某种方式配置了CENTOS,所以每次创建文件夹或上传文件时,它都会自动具有读/写权限?

If you want new created folder/file to automatically have 777 permission, you must set umask to 000. 如果希望新创建的文件夹/文件自动具有777权限,则必须将umask设置为000。

Ref: Setting the umask of the Apache user 参考: 设置Apache用户的umask

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM