#32708 [Fbk->Opn]: ftp_nlist and ftp_rawlist not working in ver 5
| From: | predecess at hotmail dot com | Date: | Fri, 15 Apr 2005 15:27:55 +0000 |
| Subject: | #32708 [Fbk->Opn]: ftp_nlist and ftp_rawlist not working in ver 5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-77604@lists.php.net to get a copy of this message | ||
ID: 32708
User updated by: predecess at hotmail dot com
Reported By: predecess at hotmail dot com
-Status: Feedback
+Status: Open
Bug Type: FTP related
Operating System: Red Hat Enterprise Linux
PHP Version: 5.0.3
New Comment:
Thanks for the reply. Unfortunately this is on a production server and
we don't test CVS on it. When 5.0.5 comes out, I'll push for us to
install that and then update this thread.
Previous Comments:
------------------------------------------------------------------------
[2005-04-15 14:17:21] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-04-14 22:02:22] predecess at hotmail dot com
Description:
------------
ftp_nlist does not work anymore, nor does ftp_rawlist.
Code that used ftp_nlist worked fine on PHP 4.3.9 and simply copying
the code to a server running PHP 5.0.3 breaks it.
The /tmp directory's mode/permissions is set to 777
Reproduce code:
---------------
<?php
// Get FTP file list
$ftpconn = ftp_connect('ftp.example.com');
if ($ftpconn) {
if (ftp_login($ftpconn, 'username', 'password')) {
$path = '/this/same/task/works/fine/with/a/url/wrapper/';
$files = ftp_nlist($ftpconn, $path);
foreach ($files AS $filelist) {
echo $filelist.'<br>';
}
}
}
?>
Expected result:
----------------
this/same/task/works/fine/with/a/url/wrapper/file1.txt
this/same/task/works/fine/with/a/url/wrapper/file2.txt
this/same/task/works/fine/with/a/url/wrapper/file3.txt
this/same/task/works/fine/with/a/url/wrapper/file4.txt
Actual result:
--------------
Warning: Invalid argument supplied for foreach() in
/documentroot_path/ftpBUG.php on line 9
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32708&edit=1