0

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?

amandanovaes
  • 624
  • 2
  • 7
  • 17

1 Answers1

0

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

Community
  • 1
  • 1
Brightshine
  • 955
  • 7
  • 17
  • Sir selinux is already disabled in my server cause it caused me more harm than good. Hope you can tell me how to make a new created folder/file to automatically have 777 permission as it is created. – amandanovaes Apr 17 '14 at 03:13
  • Oh sorry, I found I misunderstood what you want. What you need to do it to change umask of apache/php. – Brightshine Apr 17 '14 at 03:28
  • Hi, I typed cd /ebs1/apache/www/html and after that I type umask 777 but everytime I create a file/folder the permission is not 777! – amandanovaes Apr 17 '14 at 03:37