hah🙂
it is working with chmod. What the heck?!
Is it safe to give them 777 though?
if someone else in trouble had trouble with this use this little bit of code to clean the mess you created while testing:
$dirs = array_slice(scandir(THE DIRECTORY TO SCAN),2);
foreach($dirs as $key => $value) {
chmod(SCANNED DIRECTORY . $value, 0777);
}