When I use this code in console:
php -r 'mkdir("./test", 0655, true);'
It works without any problem
but this fails:
php -r 'mkdir("./test/boo", 0655, true);'
with the error:
Permission denied in Command line code on line 1
Why when I want to make a nested dir tree, even I use true as third parameter I get permission denied error?
How to create nested dir tree with the mkdir() ?
I'm using PHP 7.3.0
To be able to work with directories you need execute permission (Execute vs Read bit. How do directory permissions in Linux work?) if you don't have execute permission you can't change into the directory which is a bit limiting. So you need to create them with 755 permissions...
php -r 'mkdir("./test", 0755, true);'