Installing the PHP/Java Bridge J2EE Component
---------------------------------------------

* Download and install a J2EE application server or servlet engine,
  either Oracle 10g, IBM WebSphere6 or Tomcat 4 or higher. For example
  with the command: 

    rpm -i tomcat5-5.0.30-5jpp_6fc.i386.rpm

* Download and install the PHP/Java Bridge, for example with the
  command: 

    rpm -i php-java-bridge-X.Y.Z-1.i386.rpm 

  On windows you can extract the zip download file in c:\.

* Deploy JavaBridge.war into your servlet engine or application
  server. For example with the command: 

    cp JavaBridge.war /usr/share/tomcat5/webapps
    service tomcat5 restart

* Browse to http://localhost:<port#>/JavaBridge and run the
  supplied examples. For example:

    http://localhost:8080/JavaBridge/test.php

* Individual users can create .war files which use their own php
  version, for example:
  
    # unzip JavaBridge.war
    jar xf JavaBridge.war
    exe=./JavaBridge/WEB-INF/cgi/php-cgi-i386-linux

    # copy my-php-cgi to WEB-INF/cgi
    cp my-php-cgi ${exe}

    # and create a wrapper
    echo "#!/bin/sh" >${exe}.sh
    echo "chmod +x ./php-cgi-i386-linux" >>${exe}.sh
    echo "exec ./php-cgi-i386-linux" >>${exe}.sh

    # create "myBridge" webapp
    mv JavaBridge myBridge
    jar cf myBridge.war myBridge

    # deploy myBridge, for example:
    cp myBridge.war /usr/share/tomcat5/webapps

    # test
    http://localhost:8080/myBridge/test.php

  Please see the WEB-INF/cgi/README for details.

* Optionally the administrator may start a PHP standalone server for
  all users, for example:

   export X_JAVABRIDGE_OVERRIDE_HOSTS="/"
   export PHP_FCGI_CHILDREN="20"
   export PHP_FCGI_MAX_REQUESTS="500"
   /usr/bin/php-cgi -b 127.0.0.1:9667

  or he/she may set up the mod_jk adapter, for example:

  internet
  clients  <->  :80---> Apache or IIS                        --->  J2EE AS
                             | |                            /  /    |   |
                             |  mod_jk <-- jsp/servlet req./  /     |   |
                             |                               /     jsp  |
                             --- php                        /           |
                             --- php  <-- P-J-B PROTOCOL --/         servlet
                                 ...                                   ...
    Apache/IIS and J2EE ports are accessible from the
    internet. Apache/IIS and the J2EE AS share the same document root.


  or he/she may connect both, apache and the j2ee server to the
  internet, example:

                :80---> Apache or IIS
            /                |
           / php req.        ---- php
          /                  ---- php  <--| 
                                  ...     |
  internet                                |
  clients                                 |
          \                               |P-J-B
           \jsp/servlet req.              |PROTOCOL
            \                             |
                                          |
           |--> :8080--> J2EE AS          |
           |                 |            |
           |                 ---- jsp     |
           |                 ---- servlet |
           |                      ...     |
           -------------------------------|

    Apache/IIS and J2EE ports are accessible from the
    internet. Apache/IIS and the J2EE AS share the same document root.

* Please report bugs/problems to the mailing list:

    php-java-bridge-users@lists.sourceforge.net

