CHMOD all files in a folder


I’d like to create a PHP script to chmod 0644 ALL files in a specific folder and to run the script with CRON each day at the given time.

Is it possible to execute the php chmod function in a loop to affect ALL the files in the given folder?


If you’re going to do it as a cron job, why not simply call the command directly:

chmod -R 644 /path/to/folder/*

Yeah, that’s the simplest way indeed!
Thanks man!