linux - How to permanently chmod 777 for PHP -


before start killing me how should not chmod 777, rather different what's in many other topics.

the situation have directory not accessible web (/var/lib/folder/) want php able access can read, write , execute directory.

a simple solution chmod (as root), 777 folder, here comes problem. user, john, writes directory. know, files john write entitles him owner, , such php not owner. somehow, files john write become 755 instead of 777 (and result php cannot access).

is there way either:

  1. make john write directory in 777 or
  2. make directory such files john write become accessible php.

you don't need chmod.

set acl on directory:

setfacl -r -d -m u:php:rwx /var/lib/folder/  

this gives user php rwx rights new files (-d = default).

you can change acl existing files in folder with:

setfacl -r -m u:php:rwx /var/lib/folder/ 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -