简体   繁体   中英

Permission with Apache on CENTOS

I installed LAMP in my CENTOS and it all looks fine. In my www/html/ folder I placed my script and they all work fine, they can write/read everything. 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.

Everytime it happens I need to chmod 777 to that folder and all the files inside. 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?

If you want new created folder/file to automatically have 777 permission, you must set umask to 000.

Ref: Setting the umask of the Apache user

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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