title: Recursive Chmod not working PHP
body: <p>I have the below PHP function that should recursively chmod one of the dir's on my server.</p>
  
  <p>For some reason it's not working - i know the path to the dir is correct as i've tested it with a quick script that just prints out the files within that dir.</p>
  
  <pre><code>$root_tmp = '/tmp/mixtape2'; 
  chmod_r($root_tmp);
  
  function chmod_r($Path) {
  $dp = opendir($Path);
  while($File = readdir($dp)) {
    if($File != "." AND $File != "..") {
       if(is_dir($File)){
          chmod($File, 0777);
          chmod_r($Path."/".$File);
       }else{
           chmod($Path."/".$File, 0777);
       }
    }
  closedir($dp);
  }
  </code></pre>
  
  <p>Any ideas?</p>