title: move_uploaded_file not working on Apache server in Linux Mint
body: <p>So I am trying to do a basic upload via an HTML form and a simple php script, but the move_uploaded_file function always returns false. I have run "chmod 777" on the directory (I will deal with safety more when I actually get this to work" and the "upload" directory is in the htdocs folder (actually /var/www in Ubuntu Server and Linux Mint).</p>
  
  <p>Here is the form:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;form action="upload_file.php" method="post"
  enctype="multipart/form-data"&gt;
  &lt;label for="file"&gt;Filename:&lt;/label&gt;
  &lt;input type="file" name="file" id="file" /&gt; 
  &lt;br /&gt;
  &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>...and upload_file.php...</p>
  
  <pre><code>&lt;?php
      if ($_FILES["file"]["error"] == 0){
          if (file_exists("upload/" . $_FILES["file"]["name"])){
              echo $_FILES["file"]["name"] . " already exists. ";
          }else{
              if(move_uploaded_file($_FILES["file"]["tmp_name"],"/var/www/upload/" . $_FILES["file"]["name"])){ 
                  echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
              }else{
                  echo "Failed to move uploaded file";
              }
          }
      }else{
          echo "Return Code: " . $_FILES["file"]["error"];
      }
  ?&gt;
  </code></pre>
  
  <p>When I try to upload a small JPEG, I get "Failed to move file". Any thoughts?</p>