#32354 [Opn->Fbk]: Warning: ftp_get(): Unable to build data connection: No route to host
| From: | tony2001@php.net | Date: | Thu, 17 Mar 2005 14:05:06 +0000 |
| Subject: | #32354 [Opn->Fbk]: Warning: ftp_get(): Unable to build data connection: No route to host | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75435@lists.php.net to get a copy of this message | ||
ID: 32354
Updated by: tony2001@php.net
Reported By: amit2001_shah at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: FTP related
Operating System: Linux
PHP Version: 4.3.8
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-03-17 14:57:54] amit2001_shah at yahoo dot com
Description:
------------
I am trying to connect one server with mine through ftp. Connection is
working nice. but when im trying to download file from the server then
its give me one Warning: ftp_get(): Unable to build data connection: No
route to host
Reproduce code:
---------------
$ftpobj = new ftpclass();
$ftp_server = "server_name";
$conn_id = ftp_connect($ftp_server);
$ftp_user_name = "user";
$ftp_user_pass = "password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if ((!$login_result))
{
echo "Attempted to connect to $ftp_server for user
$ftp_user_name has failed!";
exit;
}
$local_file = "3026_1491378_mp.txt.gz";
$remote_file = "merchandiser/3026_1491378_mp.txt.gz";
$download = ftp_get ( $conn_id, $local_file, $remote_file,
FTP_BINARY);
if ($download)
{
echo "Successfully written to $local_file\n";
}
else
{
echo "No such file or directory available for download \n";
}
Expected result:
----------------
Successfully written to $local_file
Actual result:
--------------
Warning: ftp_get(): Unable to build data connection: No route to host
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32354&edit=1