Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:51:37+00:00 2026-05-27T04:51:37+00:00

I am downloading zip files from FTP server using PHP ftp function.I used binary

  • 0

I am downloading zip files from FTP server using PHP ftp function.I used binary and passive mode to get file.
The problem is that when I stopped the ftp operation before the completion of ftp operation(ie ftp_close() was not called) and when it was started again it shows the following Warning-

  ftp_login() [http://php.net/function.ftp-login]: service unavailable
  FTP connection has failed!

And the FTP operation was failed.I have written the following code for FTP operation.

$connId = ftp_connect($host);   
$loginResult = ftp_login($connId, $user, $password);    
if ((!$connId) || (!$loginResult)) { 
    echo "FTP connection has failed!";
    exit; 
}   
ftp_pasv($connId, true);    
if (!ftp_chdir($connId, $remoteDir))
    return false;   
if (!ftp_get($connId, $localDir.$localFile,$remoteFile,FTP_BINARY))
    return false;   
ftp_close($connId);

How to forcefully destroy ftp connection which has started getting files in binary mode and the connection is in passive mode?
Rebooting the machine or deleting the session cookies did not help me.What might be the possible solution for it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:51:38+00:00Added an answer on May 27, 2026 at 4:51 am

    Rebooting a machine always closes all connections made by or to that machine.

    ftp_login() [http://php.net/function.ftp-login]: service unavailable
    FTP connection has failed!

    It looks like the remote FTP server is terminating the connection before you ever get to the login step. Check that your credentials are correct and check to make sure the FTP server is operating correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After downloading files from a remote UNIX FTP server, you want to verify that
I've never used the checksum when downloading various executables or zip files from the
I am using ASIHTTPRequest for downloading file from server but its giving error Failed
I'm using python to programatically download a zip file from a web server. Using
I am developing c# application, in which i am downloading package(zip file) from server
My java program uploads a zip file from my system to FTP server. uploadfile()
Recently I started taking this guide to get myself started on downloading files from
I have a zip archive artifact. I'm interested in downloading a single file from
I'm downloading from FTP server and I don't know exactly how to check if
I'm trying to download a large .zip file from a web server but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.