title: Xampp / OS X - Unable to create temporary file. Check permissions in temporary files directory
body: <p>I know that i am not the first one facing this problem, but all the answers didn't help me. </p>
  
  <p>I am running OS X Siera 10.12.6 with Xampp 7.1.9-0 and trying to get a file list from a remote ftp server like this:</p>
  
  <pre><code>        $this-&gt;log('Changing to destination folder '.$config-&gt;folder.' on ftp server.',2);
          ftp_chdir($ftpConnection, $config-&gt;folder);
  </code></pre>
  
  <p>This is the returned error message:
      Warning: ftp_nlist(): Unable to create temporary file. Check permissions in temporary files directory. in /Users/foobar/Websites/local/foobar/class.importCsv.php on line 158</p>
  
  <pre><code>Warning: Invalid argument supplied for foreach() in /Users/foobar/Websites/local/foobar/class.importCsv.php on line 160
  </code></pre>
  
  <p>When checking the output of phpinfo(); and looking for any given tmp-setting I get those paths / parameters that might be of interest:</p>
  
  <pre><code>upload_tmp_dir: /Applications/XAMPP/xamppfiles/temp/
  soap.wsdl_cache_dir /tmp    
  TMPDIR: /var/folders/qq/912038129312390812903812093/T/
  SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.f0uSENezH9/Listeners
  upload_tmp_dir: /Applications/XAMPP/xamppfiles/temp/    
  Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.aOzrWGVthG/Render
  </code></pre>
  
  <p>So I am going to change the folder permissions of all those folders:</p>
  
  <pre><code>chmod a+w /Applications/XAMPP/xamppfiles/temp
  chmod a+w /private/tmp/
  chmod a+w /tmp  
  </code></pre>
  
  <p>the last one is not working, it returns a "operation not permitted" (yes, I used sudo -i):</p>
  
  <pre><code>chmod a+w /var/folders/qq/9qwrj72x6sz73v2tgf7qddnh0000gn/T/
  </code></pre>
  
  <p>FYI: I just switched from the builtin Apache-PHP-System in OSX to Xampp so it definitely is some mis-configuration with Xampp.</p>