php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13913 Empty strings on "nlist" and "rawlist"
Submitted: 2001-11-02 17:55 UTC Modified: 2002-07-10 23:01 UTC
Votes:10
Avg. Score:4.9 ± 0.3
Reproduced:10 of 10 (100.0%)
Same Version:1 (10.0%)
Same OS:7 (70.0%)
From: phpbug at osiris dot xs4all dot nl Assigned:
Status: Closed Package: FTP related
PHP Version: 4.0.6 OS: Windows XP final
Private report: No CVE-ID: None
 [2001-11-02 17:55 UTC] phpbug at osiris dot xs4all dot nl
Thank you for hearing me :)

The problem is that whatever i try there is no data in any nlist or rawlist command i issue on my ftp server.

I started out with IIS 5.1 (standard winXP) and ended with bulletproof FTP 1.25, both not giving any listings..

Some sample code:

--------------

$dir=ftp_pwd($conn_id); 

$rawlist = ftp_rawlist($conn_id,$dir);
$nlist = ftp_nlist($conn_id,$dir);
         
if ($rawlist) { echo "<BR>Spawned value for nlist was ".$nlist; }
else { echo "<BR>empty as usual.."; }
if ($rawlist) { echo "<BR>Spawned value for rawlist was ".$rawlist; }
else { echo "<BR>empty as usual.."; }

echo "<BR>";

print_r($rawlist);
print_r($nlist);

--------------

where there:
- was a connection in the 1st place ($conn_id)
- i encountered not a single error message
- i used the "if .. else" to prove my wrong
- i received no data in my string

I have seen various bug reports resembling what i've expierenced but none of them got answered because they all stopped giving information which ended in: "can't reproduce the error."

I hope you (the brave volunteer) could help me.. :)

Thanxx

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-07 17:04 UTC] cardinal@php.net
You're probably trying to get a listing in active mode, and being rejected.  Set the connection to passive mode with ftp_pasv() before you try to get the listing.
 [2001-11-08 02:13 UTC] phpbug at osiris dot xs4all dot nl
After adding the following code after the connection and before the listings, 

// Initiate passive mode
if (ftp_pasv($conn_id, true))
{ echo "Initiated passive mode"; }
else { echo "Could not initiated passive mode"; }

The result stays the exact same..

What i forgot to mention: i can switch directorys etc. so
the connection seems to work, but the "LIST" command never reaches the ftp server (checked).
 [2001-11-08 15:17 UTC] phpbug at osiris dot xs4all dot nl
Update:

I just validated my FTP's logs and found out that:
- The user logs in correctly
- The passive request arrived and was set correctly
- There was no list command anywhere to be found

It's just not arriving.. (?)
 [2002-07-10 23:01 UTC] sniper@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 [2004-04-22 17:47 UTC] iwarner at triangle-solutions dot com
Hi,

I have exactly the same problem still running PHP 4.3+ IIS and Windows 2003

connecting to a remote FTP server that I know has files in it, nlist and rawlist return nothing

IAn
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC