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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
9 + 12 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 14:01:30 2024 UTC