title: php script on Windows hosting does not list ftp files (ftp_rawlist issues)
body: <p>I'm trying to list some files from an external FTP server using php ftp functions on a Windows shared hosting, but I'm having several problems.</p>
  
  <p>I firstly tried with a couple of web applications like ajaxplorer and net2ftp, but I got frustrated and I decided to make a very basic script for testing..</p>
  
  <pre><code>&lt;?php   
  $ftp_server = "alinuxftpserver";
  $ftp_user = "user";
  $ftp_pass = "pass";
  
  // set up a connection or die
  $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
  
  // change temp folder (windows)
  putenv("TMP=D://inetpub//webs//domain//net2ftp//tmp");
  echo getenv('TMP'); 
  
  // try to login
  if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) 
  {
      echo "Connected as $ftp_user@$ftp_server\n";
  } 
  else 
  {
      echo "Couldn't connect as $ftp_user@$ftp_server\n";
  }
  
  if(ftp_pasv( $conn_id, true )) 
        echo "Passive mode, it worked&lt;br/&gt;"; 
      else 
        echo "Passive mode, it didn't work&lt;br/&gt;";
  
  $contents = ftp_rawlist($conn_id, ".");
  var_dump($contents);
  
  ftp_close($conn_id);  
  
  die;
  
  ?&gt;
  </code></pre>
  
  <p>On my localhost (linux) it returns an array, while on the windows hosting it returns:</p>
  
  <pre><code>Warning: ftp_rawlist() [function.ftp-rawlist]: php_connect_nonb() failed: No such file or directory (2) in D:\inetpub\webs\domain\ftp.php on line 26
  bool(false)
  </code></pre>
  
  <p>Can't understand.. the directory should be "/" on the external ftp server and of course there are some files &amp; folders (2 folders and 1 file).. In fact on my MAMP installation it works well.</p>
  
  <p>Hosting guys told me that the server configuration is ok.</p>