Req #68462 [NEW]: ftp-put: debugging fail after "PORT command successful"

From: Date: Thu, 20 Nov 2014 13:26:23 +0000
Subject: Req #68462 [NEW]: ftp-put: debugging fail after "PORT command successful"
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188710@lists.php.net to get a copy of this message
From:             stratflow at hotmail dot com
Operating system:  FreeBSD 9.2-RELEASE-p10
PHP version:      5.4.35
Package:          FTP related
Bug Type:         Feature/Change Request
Bug description:ftp-put: debugging fail after "PORT command successful"

Description:
------------
ftp_put() in some cases returns FALSE after transfer of a file.
The last logged error in $php_errormsg is 
  "ftp_put() [function.ftp-put.php]: PORT command successful"

It is unclear if this is a problem within PHP:FTP, a clientside
filesystem problem or a serverside problem.

The same script runs 100 transfers every 15 mins from one server off to
different platforms of different flavours. We have recently encountered
a HUGE increase of these errors which would indicate a problem in the
source system.

As far as we can see, there is no (documented?) way to debug this
problems and look into the server responses. There was one proposal how
to solve something like this in
  https://bugs.php.net/bug.php?id=44059
but that never made it into the tree.






Test script:
---------------

$ftp         = ftp_connect($ftphost,21,15);
$ftp_login   = ftp_login($ftp, $ftpuser, $ftppass);
$ftp_pasv    = ftp_pasv($ftp, true);

$ftp_up      = ftp_put($ftp, $trgfile, $srcfile, FTP_BINARY); 

# now check upload status:
if (!$ftp_up) { 
  print "upload check failed [" . $php_errormsg . "]<";
} else {
  print "upload successful";
}




Expected result:
----------------
Access to some sort of log of last server messages.



Note: 
The last erromessage in php_errormsg is might be misleading.

Note 2:
Unless you're transferring to a server to which you have ftp-logfile
access, it's impossible to debug this from the serverside.



Actual result:
--------------
ftp_put() returns FALSE for undebuggable reason.

Misleading or unclear messages in $php_errormsg

-- 
Edit bug report at https://bugs.php.net/bug.php?id=68462&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=68462&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=68462&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=68462&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=68462&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=68462&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=68462&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=68462&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=68462&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=68462&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=68462&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=68462&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=68462&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=68462&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68462&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=68462&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=68462&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=68462&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68462&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=68462&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=68462&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#188710) next »