kb:kb_articles:kb1056

Using FastCGI with OECGI (Web)

Using FastCGI with OECGI

OpenInsight can be made accessible to the Internet, or on an Intranet, via web browsers using OECGI and an appropriate web server.  OECGI implements the Common Gateway Interface (CGI), a standard first implemented in 1993 and updated intermittently since that time.

The CGI sequence of events can be summarized as follows:

A request comes in to a web server, with some part of the URL (the "address line") indicating that this is a CGI request;

The web server starts up the CGI process;

The CGI routine "does something" (in the case of OECGI, this involves communicating with OpenInsight and running an OI stored procedure, retrieving results from that procedure);

The CGI routine sends the results back to the web server, and terminates;

The web server returns the results to the invoking client

While all the steps involved are highly optimized, having to start up and terminate the CGI process for each request imposes some additional performance overhead.  Therefore, in 1996, a company named Fast CGI created their own server that "sat on top of" the web server, and kept the CGI process in-memory.  Since that time, all the major web servers have implemented their own FastCGI interface, eliminating the startup and shutdown overhead.

OECGI can be configured to run in FastCGI, if required in a high-performance environment, through the use of PHP and OECGI3P.PHP.

If you wish to run OECGI in FastCGI for Microsoft’s Internet Information Services (IIS) web server, Microsoft explains how to configure FastCGI for PHP in the following technet article:

https://technet.microsoft.com/en-us/library/dd239230(v=ws.10).aspx

First, you must first download PHP from the following site (Note: for fastcgi you need to download the non-thread-safe version):

http://windows.php.net/download#php-5.6

Once downloaded, copy php-production.ini to php.ini

Edit the settings per the technical bulletin, including setting the open_basedir item.  For an O4W-only installation, set "open_basedir" to point to the O4W folder.  If you need open_basedir to point to a different folder, then copy the OECGI3.php and ini file to that folder.

Configure IIS per that bulletin.

Enable CGI, then set up a fast cgi handler mapping for php

Add a virtual directory to your webserver .  Here it is "oifast".  It should point to the O4W folder under OpenInsight, which is where the oecgip3.php file lives.

Once the virtual directory has been created, and the handler mapping for *.php set to use FastCGI, you can connect to your virtual directory and you should see the normal O4W behavior (NOTE: be sure to use startp.htm as your "start page" for O4W in this instance, rather than start.htm; startp.htm uses OECGI3P.PHP, while start.htm uses OECGI3.EXE).

  • kb/kb_articles/kb1056.txt
  • Last modified: 2024/01/30 13:36
  • by 127.0.0.1