Using PHP/FI with Zeus Web Server.

PHP/FI is a third party, server side scripting language, allowing you to embed sophisticated control constructs directly into your HTML pages. PHP/FI also contains extensive database connectivity tools, allowing Application Server to connect to a wide range of industry standard DBMS servers. PHP/FI is currently supported in Application Server by using CGI handlers, FastCGI support will be released soon.

PHP/FI is written by Rasmus Lerdorf along with additional people on the Internet. The official PHP/FI web site is at http://php.iquest.net/, the latest versions of the software and pointers to support mailing lists are available on the site. The latest PHP/FI Application Server information is available from the Zeus PHP/FI homepage.

Compiling PHP/FI
Compiling PHP/FI is well documented in the README file in the archive, you should refer the PHP documentation for specific instructions about compiling on your platform.

The PHP/FI install.sh script asks a number of questions regarding file locations, one of which is the location of the docroot for your server. If you wish to use the same PHP/FI binary across multiple virtual servers you will need to remove the DOCUMENT_ROOT reference in the /src/Makefile file before typing make to compile the software. This can be done by manually editing Makefile and searching for line starting with CPPFLAGS. Remove the preprocessor symbol definition :

-DPHP_DOCUMENT_ROOT=\"/usr/local/etc/htdocs\"

Alternatively you can run the following command which will make the update for you.

sed 's/-DPHP_DOCUMENT_ROOT=[^ ]*//g' Makefile > p; mv p Makefile

Configuring the Admin Server
Once you have successfully compiled php.cgi you will need to copy it to a CGI script alias directory for your servers. For details on setting script aliases see the associated documentation. You will then need to create a handler to map PHP files to the php.cgi program.

You should be aware that when running PHP as a CGI program it does not read any htaccess files nor is it affected by any admin server restriction policies. It is possible for a client to circumvent these policies if they know the location of the php.cgi program. We advise that you place the php.cgi program in a unique script alias directory, which is not publicly known.

PHP files traditionally end in the .phtml extension, although any extension can be used. For full details on creating handlers see the associated documentation.

Using PHP and Server Side Includes.
You can use Application Servers advanced SSI engine to parse your PHP output. PHP provides the header() function call, which allows additional HTTP header information to be output. To cause your PHP output to be parsed by Application Server, set the Content-Type header to a value of "text/x-server-parsed-html". For more details of the header() function, see the PHP documentation.