From: gordon at perridot dot com Operating system: Linux 7.3 PHP version: 4CVS-2005-08-12 (stable) PHP Bug Type: Sockets related Bug description: fsockopen data connection failed?
Description: ------------ Hi, I am using php4.1, when i try connect to the FTP server via fsockopen, after login succeesfully, i can't list or get files from the server, the system prompt me 425 Can't open data connection. How to solve this problem? Thank you... Reproduce code: --------------- $fp = fsockopen("ftpip",21); fputs($fp,"USER myname\r\n"); echo fgets($fp,4096); fputs($fp,"PASS mypassword\r\n"); echo fgets($fp,4096); fputs($fp,"TYPE A\r\n"); echo fgets($fp,4096); fputs($fp,"PASV\r\n"); echo fgets($fp,4096); fputs($fp,"RETR test.txt\r\n"); echo fgets($fp,4096); fputs($fp,"quit\r\n"); Expected result: ---------------- 425 Can't open data connection. -- Edit bug report at http://bugs.php.net/?id=34091&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34091&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34091&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34091&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34091&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34091&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34091&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34091&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34091&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34091&r=support Expected behavior: http://bugs.php.net/fix.php?id=34091&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34091&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34091&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34091&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34091&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34091&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34091&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34091&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34091&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34091&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34091&r=mysqlcfg