Bug #65963 [Com]: is_dir wrong behaviour when used with ftp on localhost
| From: | tomas dot brastavicius at quantum dot lt | Date: | Sun, 16 Feb 2014 20:37:40 +0000 |
| Subject: | Bug #65963 [Com]: is_dir wrong behaviour when used with ftp on localhost | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184326@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65963&edit=1
ID: 65963
Comment by: tomas dot brastavicius at quantum dot lt
Reported by: messaged at messaged dot lv
Summary: is_dir wrong behaviour when used with ftp on
localhost
Status: Open
Type: Bug
Package: FTP related
Operating System: Mac OS X
PHP Version: 5.5.5
Block user comment: N
Private report: N
New Comment:
You should pass a path relative to a root directory but not to a CWD of the FTP server.
Try to configure your local FTP's server in a way to chroot user's directory or try
is_dir('ftp://message:password@127.0.0.1/[FTP's
root]/www');
Previous Comments:
------------------------------------------------------------------------
[2013-10-24 19:47:21] messaged at messaged dot lv
Description:
------------
Wrong behaviour when i use is_dir() on localhost. Works as expected on external php.
Test script:
---------------
[19] boris> $ftp = ftp_connect('localhost');
â resource(39) of type (FTP Buffer)
[20] boris> ftp_login($ftp, 'message', 'password');
â true
[22] boris> ftp_nlist($ftp,'.');
â array(
42 => 'Applications',
43 => 'Desktop',
44 => 'Documents',
45 => 'Downloads',
46 => 'Dropbox',
47 => 'fixtures',
49 => 'Library',
52 => 'Movies',
53 => 'Music',
56 => 'Pictures',
57 => 'Public',
58 => 'springsource',
59 => 'temporary_fixtures',
61 => 'www'
)
[23] boris> is_dir('ftp://message:password@127.0.0.1/www');
â false
[24] boris> is_dir('ftp://message:password@127.0.0.1/temporary_fixtures');
â false
[25] boris> is_dir('ftp://message:password@127.0.0.1/');
â true
[26] boris> is_dir('/Users/message/www');
â true
Expected result:
----------------
[23] boris> is_dir('ftp://message:password@127.0.0.1/www');
â true
Actual result:
--------------
[23] boris> is_dir('ftp://message:password@127.0.0.1/www');
â false
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65963&edit=1