php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34091 fsockopen data connection failed?
Submitted: 2005-08-12 06:16 UTC Modified: 2005-08-20 01:00 UTC
From: gordon at perridot dot com Assigned:
Status: No Feedback Package: Sockets related
PHP Version: 4CVS-2005-08-12 (stable) OS: Linux 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gordon at perridot dot com
New email:
PHP Version: OS:

 

 [2005-08-12 06:16 UTC] 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. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 05:05:52 2022 UTC