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:
- make john write directory in 777 or
- 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
Post a Comment