title: Randomly get failed to open stream: Permission denied with fopen()
body: <p>It's actually working, it will open and work with file, but sometimes it shows up this error: </p>
  
  <blockquote>
    <p>Warning: fopen(some_address\backup.php): failed to open stream:
    Permission denied in C:\Program Files(x86)...."</p>
  </blockquote>
  
  <p>After refreshing the page (f5) everything works fine again, but still it's kinda annoying and thanks to this It's not too much "user friendly" code... Don't you know why?</p>
  
  <pre><code>private function doBackup($file){
          $file_index_content = file_get_contents($file);
          $file_backup = $this-&gt;Path."/backup.php";
          if(file_exists($file_backup)){
              unlink($file_backup);
              $file_backup_open = fopen($file_backup, "w"); //THIS ONE IS DOING THE ERROR!!
              fwrite($file_backup_open, $file_index_content);
              fclose($file_backup_open);
          }else{
              $file_backup_open = fopen($file_backup, "w");
              fwrite($file_backup_open, $file_index_content);
              fclose($file_backup_open);
          }
          return true;
      }
  </code></pre>