|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-11-10 06:20 UTC] jmichae3 at yahoo dot com
Description:
------------
PHP Warning: ftp_put(): Accepted data connection in C:\www\jimm\ftp6.php on line 122
is this really an error state for ftp_put? I would think it would be a success! PHP is returning an error on this.
I think this is a bug.
Reproduce code:
---------------
if (ftp_put($conn_id, basename($dest_file), $src_file, FTP_BINARY)) {
echo "success\n";
} else {
echo "error\n";
}
Expected result:
----------------
success
Actual result:
--------------
the server I am working with is having problems. lately it is really slow, and I get about 6 successful files uploaded, and the rest (about 450+ files) are
PHP Warning: ftp_put(): Accepted data connection in C:\www\jimm\ftp6.php on line 122
error
also, subsequent attempts at a ftp_mkdir also fail.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
I will not be able to reproduce this bug until something on the network goes nuts again. in my case, it was my cable modem configuration combined with an ISP network upgrade. after persistently trying to get an internet connection again (and many calls to tech support), I did. All is well now with my connection so I can't test the Accepted data connection error, but I did test mkdir and it appears to be working. //ftp mkdir test function mk($conn_id) { echo "chdir\n"; if (!ftp_chdir($conn_id, "/public_html/")) { echo "chdir failed\n"; return; } echo "mkdir test\n"; if (!ftp_mkdir($conn_id, "/public_html/test")) { echo "mkdir failed\n"; return; } echo "chdir test\n"; if (!ftp_chdir($conn_id, "/public_html/test")) { echo "chdir failed\n"; return; } } // set up basic connection $conn_id = ftp_connect($host); // login with username and password $login_result = ftp_login($conn_id, $uid, $pwd); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!\n"; echo "Attempted to connect to $host for user $uid\n"; exit; } else { echo "Connected to $host, for user $uid\n"; } ftp_pasv($conn_id, true); mk($conn_id); // close the FTP stream ftp_close($conn_id);Environment ------------ PHP Version 5.2.4-2ubuntu5.3 Apache 2.0 Application: zip files http upload, decompression on webserver, ftp directory creation and files ftp transfer to remote ftp server; Situation: a zip file with 2 directories within, each containig one file; Reproduce Code -------------- if(!ftp_put($this->conn_id,$target,$tmp_file_name,$ftp_mode)){ ....//set debug information } $ftp_mode is 2 Actual Result ------------- The two files have been transfered correctly but the second operation gave this error:Warning: ftp_put() [function.ftp-put]: Accepted data connection