#34091 [Opn->Fbk]: fsockopen data connection failed?
| From: | bjori@php.net | Date: | Fri, 12 Aug 2005 05:29:57 +0000 |
| Subject: | #34091 [Opn->Fbk]: fsockopen data connection failed? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83428@lists.php.net to get a copy of this message | ||
ID: 34091
Updated by: bjori@php.net
Reported By: gordon at perridot dot com
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: Linux 7.3
PHP Version: 4CVS-2005-08-12 (stable)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-08-12 06:16:46] gordon at perridot dot com
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 this bug report at http://bugs.php.net/?id=34091&edit=1