title: Able to delete files, Unable to copy or modify them - PHP
body: <p>Using the following code I receive an error when trying to copy a file, or anything else I try to do with it. I am however able to use almost identical code to delete the file. </p>
  
  <pre><code>$file = "img1.jpg";
  
  if (!copy($file, "img2.jpg")) {
    echo ("Error copying $file");
  } else {
    echo ("Copied $file");
  }
  </code></pre>
  
  <p>Delete Code:</p>
  
  <pre><code>if (!unlink($file)) {
    echo ("Error deleting $file");
  } else {
    echo ("Deleted $file");
  }
  </code></pre>
  
  <p>Anyone know why it might be doing this?</p>
  
  <p>Edit: Apache owns the files but seems to be unable to read or write them as per is_readable and is_writeable</p>
  
  <p>Edit2: added second argument to the copy code. This was not the problem, just me making errors in posting this question.</p>