Menu

[r489]: / trunk / php-java-bridge / server / WEB-INF / cgi / README  Maximize  Restore  History

Download this file

72 lines (53 with data), 2.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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 php-fcgi.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="20" \
PHP_FCGI_MAX_REQUESTS="5000" \
php-fcgi.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 "20" 
set PHP_FCGI_MAX_REQUESTS "5000"
launcher.exe -a php-cgi -b 9667


----------------------------------------------------------------------
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.

On Windows copy the php-cgi.exe and the php5ts.dll into this
directory. Copy the wrapper "launcher.exe"[1] and the libraries it
needs (e.g. msvcr70.dll) into this directory and create a PHP .ini
file called php-cgi.ini.

Start the web context, browse to http://localhost/webContext/test.php
and check if the application server has started 20 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.


[1] See PHPIntKitForWindows.zip available from
http://www-128.ibm.com/alphaworks