I want to recursively set the folder and file permissions. Folders should get 750 and files 644. I found this and made some adaptions. Would this one work?
Why don't use find tool for this?
exec ("find /path/to/folder -type d -exec chmod 0750 {} +"); exec ("find /path/to/folder -type f -exec chmod 0644 {} +");