title: upload_tmp_dir is not set properly - php.ini
body: <p>I want to upload a file to my server (Apache on RaspberryPi (raspbian) in my home network) over https and then write it to disk with PHP. I'm getting the <code>move_uploaded_file(): Unable to move '/tmp/php2W6AMo' Permission denied</code> Error. To solve this, I try to change the directory for the temporary upload files, but it's not working properly.</p>
  
  <p>This Code:</p>
  
  <pre><code>&lt;?php
  ini_set('upload_tmp_dir', '/var/www/upload_tmp_dir/');
  echo ini_get('upload_tmp_dir') .'\n';
  
  print_r($_FILES);
  
  $uploaddir = '/var/www/uploads/';
  $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
  if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
      echo "It worked.\n";
  } else {
      echo "Error!\n";
  }
  
  ?&gt;
  </code></pre>
  
  <p>produces following output:</p>
  
  <pre><code>/var/www/upload_tmp_dir
  Array
  (
      [userfile] =&gt; Array
          (
              [name] =&gt; test.txt
              [type] =&gt; application/octet-stream
              [tmp_name] =&gt; /tmp/phpq9iDg3
              [error] =&gt; 0
              [size] =&gt; 124184
          )
  
  )
  </code></pre>
  
  <p>The <code>php.ini</code> says this: <code>/var/www/upload_tmp_dir</code>. Same for <code>phpinfo()</code>.</p>
  
  <p>Why does it still upload the files to <code>/tmp</code> ? 
  Is there anything I've overseen? 
  Thank you for your help.</p>