|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-12 07:29 UTC] bjori@php.net
[2005-08-20 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 04:00:02 2025 UTC |
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.