From: rouet at in2p3 dot fr
Operating system: solaris 8
PHP version: 4.3.4
PHP Bug Type: FTP related
Bug description: ftp_get don't work on a 64 bits php release
Description:
------------
we have to use a 64 bits compiled version of php 4.3.4
to solve a limitation problem with popen.
an i discover that ftp_get function don't work.
i looked at the file ftp.c in ext/ftp and the problem is
the length of a long (8 bytes) in 64 bits mode.
that's the portion of code i modified to solve ftp
problem :
/* IP and port conversion box */
union ipbox {
unsigned int l[2];
/* unsigned long l[2];*/
unsigned short s[4];
unsigned char c[8];
};
i recompile php and now ftp-get work.
Reproduce code:
---------------
<body>
<?php
error_reporting(E_ALL);
ini_set("display_error",1);
$ftpc=ftp_connect($host);
$ftpl=ftp_login($ftpc,$user,$password);
ftp_pasv($ftpc,FALSE);
ftp_get($ftpc,$distfile,$localfile,FTP_BINARY);
ftp_pasv($ftpc,TRUE);
ftp_get($ftpc,$distfile,$localfile,FTP_BINARY);
?>
Expected result:
----------------
with passive mode off the error is
PORT required to be upper to 1024
with passive mode on the error is a timeout
--
Edit bug report at http://bugs.php.net/?id=27328&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27328&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27328&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27328&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27328&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27328&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27328&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27328&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27328&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27328&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27328&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27328&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27328&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27328&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27328&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27328&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27328&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27328&r=float