From:             anil at saog dot net
Operating system: linux FC2
PHP version:      4.3.10
PHP Bug Type:     Sockets related
Bug description:  failed to open stream: FTP server reports 220

Description:
------------
using fopen function for ftp connections on default port (21) without
declaring port in function, brings an strange error;

Reproduce code:
---------------
$handle = fopen("ftp://[EMAIL PROTECTED]/bug.txt", "r");
$oldContent = fread($handle,5000000);
fclose($handle1);



Expected result:
----------------
as you see port is default (21) and not declared in function, this code
gives error;
"failed to open stream: FTP server reports 220"

as you know 220 means connection accepted, and it is not an error. But if
you change the remote port (for example 2122) and/or declare it in
function, there will be no problem;

$handle = fopen("ftp://[EMAIL PROTECTED]:2122/bug.txt", "r");

or if you can't change the remote port;

$handle = fopen("ftp://[EMAIL PROTECTED]:21/bug.txt", "r");



-- 
Edit bug report at http://bugs.php.net/?id=33252&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33252&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33252&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33252&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33252&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33252&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33252&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33252&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33252&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33252&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33252&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33252&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33252&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33252&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33252&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33252&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33252&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33252&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33252&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33252&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33252&r=mysqlcfg

Reply via email to