If this directory contains a PHP FastCGI executable called
php-cgi-<architecture>-<os>[.exe|.sh], the PHP/Java Bridge library
tries to call it via a /bin/sh wrapper (see launcher.sh) or via a
"launcher.exe" when the server or the web context starts:


   internet 
  clients 
        \                    
         \ jsp/servlet/php req.                     .
           \                                        .
            ---- :8080 -- J2EE AS                   .
           /                 |                      .
          |                  |                      .
          |                  ---- servlet         /------ :9667
          |                  ---- FastCGIServlet /  .   PHP FastCGI Server
          |                  ---- jsp               .        |
          |                  ->-- PhpJavaServlet    .        \--- php
          |                  ---- ...            \ ------->--\--- php -->|
          |                                         .  P-J-B      ...    |
          |                                         .  PROTOCOL          |
          ------------------------------<--------------------------------|
                                   P-J-B PROTOCOL   .




UNIX: If /bin/sh is available and the php-cgi supports the -b flag,
the library executes the following command during startup:

REDIRECT_STATUS="200" \
X_JAVABRIDGE_OVERRIDE_HOSTS="/" \
PHP_FCGI_CHILDREN="5" \
PHP_FCGI_MAX_REQUESTS="5000" \
launcher.sh php-cgi-arch-os -c php-cgi-arch-os.ini -b 127.0.0.1:9667


WINDOWS: If /bin/sh is not available or if the php-cgi.exe does not
support the -b flag, the library executes the following command during
startup:

set REDIRECT_STATUS "200"
set X_JAVABRIDGE_OVERRIDE_HOSTS "/"
set PHP_FCGI_CHILDREN "5" 
set PHP_FCGI_MAX_REQUESTS "5000"
launcher.exe PHP-CGI NAMED-PIPE PHP-OPTIONS


----------------------------------------------------------------------
Installation:

On Unix compile a FastCGI PHP binary and copy it into this directory
and rename it to php-cgi-arch-os. Create a /bin/sh wrapper called
php-cgi-arch-os.sh and create a PHP .ini file, see the
php-cgi-i386-linux.sh and php-cgi-i386-linux.ini for a template.

Example for i386 linux:

  php-cgi-i386-linux.sh  # starts the ./php-cgi-i386-linux binary
  php-cgi-i386-linux     # loads php-cgi-i386-linux.ini
  php-cgi-i386-linux.ini # loads java-i386-linux.so
  java-i386-linux.so     # the optimized PHP/Java Bridge extension
  

On Windows copy the php-cgi.exe and the php5ts.dll into this
directory. Create a PHP .ini file called php-cgi.ini.

Example for php4, x86 windows:

  php-cgi-x86-windows.exe # php-cgi.exe, loads php.ini
  php4ts.dll              # required by the .exe
  php.ini                 # loads java-x86-windows.dll
  java-x86-windows.dll    # the optimized PHP/Java Bridge extension


Start the web context, browse to http://localhost/webContext/test.php
and check if the application server has started 5 php-cgi-arch-os
executables.

If the FastCGI SAPI fails, the bridge writes a message to the log, the
FastCGIServlet is switched off and the PhpCGIServlet takes over.

