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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sat Dec 21 16:01:28 2024 UTC