ftp_get help on windows server

Discussion in 'PHP' started by rfresh, Mar 13, 2009.

  1. #1
    I have a small test script in which I am trying to download a file from my windows server. My script is running on a linux server. I can't login:

    Warning: ftp_login() [function.ftp-login]: Login authentication failed.

    The script works fine if I try to connect to a linux box, I can connect, login and download the file. But it won't work on my windows server. This is my first windows server so I don't know if I'm missing something.

    $php_host_username = "username"; 
    $php_host_password = "pw"; 
    $conn = ftp_connect("ftp.mysite.com"); 
    ftp_pasv($conn, TRUE);
    if ($conn) 
       { 
         echo "ftp connect ok<br>"; 
         if (ftp_login($conn,$php_host_username,$php_host_password)) 
            { 
              echo "ftp_login ok<br>"; 
              if (ftp_get($conn,"dest.txt", "wwwroot/source.txt",FTP_ASCII)) 
                 { 
                   echo "ftp_get ok<br>"; 
                 } 
              else 
                 { 
                   echo "ftp_get fail<br>"; 
                 } 
            } 
         else 
            { 
              echo "ftp_login failed<br>"; 
            } 
       } 
    else 
       { 
         echo "ftp connect failed<br>"; 
       } 
    ftp_close($conn);  
    PHP:
     
    rfresh, Mar 13, 2009 IP
  2. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #2
    What kind of Windows server you have ? Maybe you've not configured it ( added users ) ?
     
    ActiveFrost, Mar 13, 2009 IP
  3. rfresh

    rfresh Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm new to windows hosting so I can't answer your question - its a hosting account with AccuWebHosting and they have no answers either.
     
    rfresh, Mar 13, 2009 IP