I have a directory named cache
in /var/www
, where I need to provide permission in following way:
sudo chmod -R 777 cache
but that's not enough because PHP script automatically creates sub-directories under that for better file management like a
, b
, c
... and so on. Now here whenever any new directory gets created it does not inherit permission from parent directory "cache" instead it stays with drwxr-xr-x
access instead of drwxrwxrwx
.
Can anyone help?
chmod()
function every time the new directory is created or create a cronjob that runschmod -R 777 var/www/cache
.setfacl
command.