Introduction

wxJS_fcgi is a FastCGI process. Use this to create dynamic webpages with JavaScript, E4X, wxWidgets portable code, ... on a webserver that supports FastCGI.

Configuration

mod_fastcgi on Apache

This configuration is tested with Apache 2.2.6. If you haven't installed Apache yet, I recommend you to use the latest XAMPP distribution. It contains everything you need to develop websites on an Apache server.

Download mod_fastcgi from FastCGI, install it and configure it as follows:

          LoadModule fastcgi_module modules/mod_fastcgi.dll
          FastCGIExternalServer "c:/xampp/htdocs/fcgi" -host localhost:9000
          <Directory c:/xampp/htdocs/fcgi>
              Options execCGI
              AllowOverride None
              Order allow,deny
              Allow from all
          </Directory>
         

Before requesting pages, you need to start wxJS_fastcgi (no need to pass the port argument, because 9000 is the default).

An example

Each request is run in its own context. The following objects are constructed before the script is run: fcgi which is a FCGI.

This example is a simple echo program:

fcgi.write("Content-type: text/html; charset=iso-8859-1\r\n\r\n" ); 
// cgi response: http://www.ietf.org/rfc/rfc3875
var params = fcgi.getParam();
for(i in params)
{
  fcgi.write("<b>");
  fcgi.write(i);
  fcgi.write("</b>");
  fcgi.write(params[i]);
  fcgi.write("<br />");
}

Arguments

The following arguments are available when starting the FastCGI server

  /s, --silent                  Don't show the status information
  /h, --help                    Shows this help.
  /v, --version                 Show the version of wxJavaScript.
  /c, --contextsize=<num>       Set the context stack size for the
                                JavaScript engine. Default is 8192.
  /o, --output=<str>            Redirect the output to the file.
  /m, --module=<str>            Loads the given module. Put multiple modules 
                                between quotes and separate with a :
  /cfg:<str>                    The name of the file that defines all 
                                modules. Default is modules.xml.
  /r, --runtimesize=<num>       Sets the runtime size. The default is 1MB.
  /e, --encoding=<enc>          The encoding of the scriptfile 
                                (default is UTF-8)
  /p, --port=<port>             The port where the FastCGI should listen. (Default is 9000)




SourceForge.net Logo Support This Project

All Classes

FCGI

Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.