Skip to content


Subversion checkout URL

You can clone with
Download ZIP
NanoFTPd FTP Server with MogileFS Backend
PHP Shell D
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This is a FTP daemon based on nanoftpd written in PHP. It has a MogileFS
backend that uses the MogileFS PECL extension.

Basic upload, download, deletion is possible but not all FTP commands can be
translated to MogileFS command (eg. chmod).

The original nanoftpd version has been modified to be multi process capable
and some unmaintained code has been removed.

This is production safe quality software and we used it several month while
migrating to MogileFS.

Author: Andre Pascha <>

Original Nanoftpd Site:
Original Nanoftpd Authors:
Arjen <>
Phanatic <>

You need at least PHP 5.2.6 and these PHP extensions to run mogilefs-ftpd:

* sockets 
* pcntl
* posix
* PECL MogileFS (>= 0.9.1) (
* PECL proctitle (optional)

There is a logrotate config and a init script available in the contrib

adjust values in config.php and start the deamon. 

mogilefs->listlimit = 1000;
limit of the list returned by LIST command. Set as low as possible for best
performance. :)

mogilefs->extendedlist = true;
this will enable meta data lookup for every file in the LIST output. If you
don't need the file length in the output, let this off to avoid lookups and
speed up listing.

mogilefs->searchlist = true;
allow you to search mogilefs files via LIST <search prefix>. So LIST test will
search for any files matching <class>/test*.

mogilefs->canrename = true;	
allow rename commands to be translated into MogileFS commands. 

mogilefs->canmkdir = true;
on mkdir command create a MogileFS class with the given directory name.

mogielfs->canrmdir = true;
on rmdir command delete a MogileFS class with the given directory name. 

mogilefs->mindevcount = 2;
mindevcount parameter for creating MogileFS classes.

mogilefs->defaultclass = "default";
mogilefs class to use when when uploading files in MogileFs_FlatNS.

IO Modules
There is an IO module interface defined in modules/Io/Interface.php. You can
implement your own modules and plug them into nanoftpd. There are some modules
in modules/Io to illustrate what you can do with it.

Basic file backend. No MogileFS Support. 

MogileFs Backend where the first directory level represents the MogileFs
classes. MogileFs filenames are always prefixed by the current class. 

MogileFs Backend with flat namespace. All files get listed into the root
directory. MogileFs class is taken from mogilefs->defaultclass when uploading

MogileFs Backend with domain namespace. First directory level represents the
MogileFs domains and the second the corresponding classes. 

MogileFs Backend where the logged in user is used as the MogileFS Domain.

Auth Modules
You can create authentication plugins. Check the interface definition at 
modules/Auth/Interface.php. Currently only one module is implemented which
used a text based user database.

1. default path convention is <mogilefs class>/<filename>. If your MogileFS is not
using this convention you can still use this module but you may have to 
adjust io_mogilfs.php.

2. PHP error logs go to log/nanoftpd.err. Application logs go to

3. password for the shipped users in users text database is 'test'.

4. when listing files in classes there is a limit for the list.  If you have 
a large MogileFS class it doesn't really makes sense to list millions of 
files (tough it is possible if you adjust the listlimit).

5. MKD command can create MogileFS classes and RMD can delete them. 

6. you can even rename files in MogileFS using the RNFR RNTO commands.

Used to work with:
* PHP FTP extension of PHP 5.2.6 
* FileZilla on Ubuntu
* Cyberduck Version 4.0.2 (8601) on MacOS X
Something went wrong with that request. Please try again.