PHP/FI Introduction Top File Archive Search View Source

PHP/FI is a server-side html-embedded scripting language. It lets you write simple scripts right in your .HTML files much like JavaScript does, except, unlike JavaScript PHP/FI is not browser-dependant. JavaScript is a client-side html-embedded language while PHP/FI is a server-side language. PHP/FI is similar in concept to Netscape's LiveWire Pro product, or Microsoft's ASP (Active Server Pages) although PHP actually predates both.

Before starting a project based on PHP/FI I would encourage you to investigate both LiveWire and ASP. If you know how to program in Perl and run an Apache web server, have a look at mod_perl. My general rule of thumb for choosing between Perl and PHP is:

If the page is HTML-heavy, choose PHP.
If the page is Script-heavy, choose Perl.
Assuming of course you know and like Perl. For simple database-enabled web projects, the speed and simplicity of PHP is very hard to beat.

Major Features

 * Standard CGI, FastCGI and Apache module Support
As a standard CGI program, PHP/FI can be installed on any Unix machine running any Unix web server. With support for the new FastCGI standard, PHP/FI can take advantage of the speed improvements gained through this mechanism. As an Apache module, PHP/FI becomes an extremely powerful and lightning fast alternative to CGI programmimg.

 * Include File
You can easily build an entire site made up using individual small components. For example, on this page the top part of the page is coming out of a separate header file. Changing the look and feel of this site is as easy as editing a single file.

 * Pipes and Sockets
You can open pipe and socket connections to anything. That means you can very easily send email, connect to another web page and grab something, or communicate with some custom application and have the results show up right in your web page.

 * Access Logging
With the access logging capabilities of PHP/FI, users can maintain their own hit counting and logging. It does not use the system's central access log files in any way, and it provides real-time access monitoring. The Log Viewer Script provides a quick summary of the accesses to a set of pages owned by an individual user. In addition to that, the package can be configured to generate a footer on every page which shows access information. See the bottom of this page for an example of this.

 * Access Control
A built-in web-based configuration screen handles access control configuration. It is possible to create rules for all or some web pages owned by a certain person which place various restrictions on who can view these pages and how they will be viewed. Pages can be password protected, completely restricted, logging disabled and more based on the client's domain, browser, e-mail address or even the referring document.

 * mSQL Support (version 1.0.x and 2.0.x)
mSQL is a simple and lightweight SQL Engine for Unix systems. PHP/FI provides support for embedded SQL right from a .html file. There is no simpler way of building a database-enabled web page system than with the combination of mSQL or one of the other supported RDBMS packages and PHP/FI.

 * Postgres Support
Postgres is an advanced free RDBMS. PHP/FI supports embedding Postgres95 and PostgreSQL SQL queries directly in .html files.

 * MySQL Support
MySQL is an advanced free (for non-commercial use) RDBMS. PHP/FI supports embedding mysql SQL queries directly in .html files.

 * Solid Support
Sybase Support
Sybase is a commercial RDBMS. PHP/FI supports embedding Sybase SQL queries directly in .html files.

 * Oracle Support
Oracle is a commercial RDBMS. PHP/FI supports embedding Oracle SQL queries directly in .html files.

 * Illustra Support
Illustra is a commercial RDBMS. PHP/FI supports embedding Illustra SQL queries directly in .html files.

 * Adabas Support
Adabas D is an advanced RDBMS that is available on many platforms. A special version, the so called Personal Edition is available for Linux and Win32 at no cost. It is resticted to 5 simulataneous users and 100 MB of data. For more information on Adabas D refer to

 * Filepro Support
Filepro is a commercial RDBMS. PHP/FI supports embedding Filepro queries directly in .html files.

 * ODBC Support
ODBC is a database independant method for sending queries. PHP/FI supports embedding ODBC queries directly in .html files.

 * DBM Support
DBM files are heavily used in Unix environments and provides a simple mechanism for storing hash key - content pair combinations that can then quickly be looked up. PHP/FI supports the standard set of dbm access functions.

 * RFC-1867 File Upload Support
File Upload is a new feature in Netscape 2.0. It lets users upload files to a web server. PHP/FI provides the actual Mime decoding to make this work and also provides the additional framework to do something useful with the uploaded file once it has been received.

 * HTTP-based authentication control
PHP/FI can be used to create customized HTTP-based authentication mechanisms for the Apache web server.

 * Variables, Arrays, Associative Arrays
PHP/FI supports typed variables, arrays and even Perl-like associative arrays. These can all be passed from one web page to another using either GET or POST method forms.

 * Conditionals, While Loops
PHP/FI supports a full-featured C-like scripting language. You can have if/then/elseif/else/endif conditions as well as while loops and switch/case statements to guide the logical flow of how the html page should be displayed.

 * Extended Regular Expressions
Regular expressions are heavily used for pattern matching, pattern substitutions and general string manipulation. PHP/FI supports all common regular expression operations.

 * Raw HTTP Header Control
The ability to have web pages send customized raw HTTP headers based on some condition is essential for high-level web site design. A frequent use is to send a Location: URL header to redirect the calling client to some other URL. It can also be used to turn off cacheing or manipulate the last update header of pages.

 * On-the-fly GIF image creation
PHP/FI has support for Thomas Boutell's GD image library which makes it possible to generate GIF images on the fly.

 * ISP "Safe Mode" support
PHP/FI supports a unique "Safe Mode" which makes it safe to have multiple users run PHP scripts on the same server.

 * Win95/NT Support
A PHP/FI binary is available that can run as a CGI under most Win95/NT web servers. Efforts are underway to build a full ApacheNT mod_php module with full ODBC support.

 * It's Free!
One final essential feature. The package is completely free. It is licensed under the GPL which allows you to use the software for any purpose, commercial or otherwise. See the GNU Public License document for complete details.


  • Large parts of this code were developed at and for the University of Toronto. Many thanks to Lee Oattes of the Network Development Department at the university for constant constructive criticism.
  • The Postgres95 support code was written by Adam Sussman <>
  • The Sybase support code was written by <>
  • The Solid support code was written by Jeroen van der Most <>
  • The Illustra support code was written by <>
  • The Oracle support code was written by <>
  • Countless others have helped test and debug the package.