title: PHP Function Rename Permission denied
body: <p>In server, script create new folder, set chmod to 0777, but then it tryes to move files to that folder i get error: Permission denied.</p>
  
  <pre><code>mkdir("../".$new_1, 0777);
  chmod("../".$new_1, 0777);
  
  mkdir("../".$new_1."/".$new_2, 0777);
  chmod("../".$new_1."/".$new_2, 0777);
  
  rename("files/".$failai[$i].".jpg", "../".$new_1.'/'.$new_2."/".$failai[$i].".jpg");
  </code></pre>
  
  <blockquote>
    <p>Warning: rename(files/new_file.jpg,../112a/112b/Tech_diz_1.jpg) [function.rename]: Permission denied in ..code/Jpg&amp;Html.php on line 82</p>
  </blockquote>
  
  <p>Any solutions?</p>