|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-17 15:05 UTC] tony2001@php.net
[2005-03-25 01:46 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 13:00:01 2025 UTC |
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