Archive

Posts Tagged ‘command line interface’

nanoFTPd: An ftp server written in PHP

May 18th, 2009 Jigish Thakar No comments

nanoFTPd is an ftp daemon written in php. as of version 4.2.0, php supports the command-line interface (stable since 4.3.0), which nanoFTPd relies on. nanoFTPd is modular, so it’s easy to add custom modules and other stuff, like different database interfaces (currently supports mysql and postgresql).

Features

  • user authentication via a database/textfile
  • mysql + posgresql support
  • passive mode
  • dynamic ip support
  • basic ftp commands
  • logging

Requirements

  • PHP 4.2.0 or above
  • A database server (mysql or postgres)
  • PHP extension: cli
  • PHP extension: sockets
  • PHP extension: posix

Note: for best performance, compile php with –disable-cgi

Configuring

before running nanoFTPD, you need to do the following:

1) change variables in config.php
2) change the first line of nanoftpd.php to the path of your php binary

Installing

installing is fairly straight forward. you only have to copy the whole directory (with subdirectories) into a directory of your choice… e.g. /usr/share/nanoftpd
(working on a better structure — e.g. config.php into /etc, nanoftpd.php into
/usr/sbin).

Download

You can download nanoftpd here

source

Share it If you like it
  • Digg
  • Reddit
  • Facebook
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz
  • Google Bookmarks
  • del.icio.us
  • DZone
  • email
  • BlinkList
  • LinkedIn
  • Live
  • RSS
  • Technorati

PHP on command line

January 5th, 2009 Jigish Thakar No comments

As of version 4.3.0, PHP supports a new SAPI type (Server Application Programming Interface) named CLI which means Command Line Interface. As the name implies, this SAPI type main focus is on developing shell (or desktop as well) applications with PHP. There are quite a few differences between the CLI SAPI and other SAPIs which are explained in this chapter. It’s worth mentioning that CLI and CGI are different SAPI’s although they do share many of the same behaviors.

The CLI SAPI was released for the first time with PHP 4.2.0, but was still experimental and had to be explicitly enabled with –enable-cli when running ./configure. Since PHP 4.3.0 the CLI SAPI is no longer experimental and the option –enable-cli is on by default. You may use –disable-cli to disable it.

know more

Share it If you like it
  • Digg
  • Reddit
  • Facebook
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz
  • Google Bookmarks
  • del.icio.us
  • DZone
  • email
  • BlinkList
  • LinkedIn
  • Live
  • RSS
  • Technorati