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.

* 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:\.

* Change the java .ini entry (usually /etc/php.d/java.ini or
  /etc/php.ini) so that php connects to the servlet backend, e.g.:
  
    [java]
    java.hosts   = "127.0.0.1:8080"
    java.servlet = User
  
  and disable the local backend (if it is installed and running), for
  example with:
  
    service php-java-bridge stop
    chkconfig php-java-bridge off
  
* Deploy JavaBridge.war into your servlet engine or application
  server. For example with the command: 

    cp JavaBridge.war /opt/jakarta-tomcat-5.5.9/webapps/
    export JAVA_HOME=/usr/java/jdk1.6.0/
    /opt/jakarta-tomcat-5.5.9/bin/catalina.sh stop
    /opt/jakarta-tomcat-5.5.9/bin/catalina.sh start

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

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

* Re-start Apache or IIS and check:

   http://yourHost.com/JavaBridge/sessionSharing.php


* Please report bugs/problems to the mailing list:

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


Individual users can create .war files which use their own php
version. Please see the WEB-INF/cgi/README for details.

When Apache or IIS is not available, 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 -dlog_errors=On -ddisplay_errors=Off -b 127.0.0.1:9667


When Apache or IIS is available, the administrator may set up the
mod_jk adapter to forward JSP/Servlet requests to the J2EE AS, for
example:

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

    J2EE port not visible to internet clients. Apache/IIS document root
    not used.


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.

Known AS Issues 
---------------

* If tomcat 5.5.9 cannot render .jsp pages: Remove the jsp-api.jar from
  the WEB-INF/lib/ folder.

* If you see a script exception when running java-server-faces/index.php
  and the name is displayed as "null", check if apache is able to
  execute the script. If not, stop apache or change the script
  location from "@80:/java-server-faces/helloWorld.php" to
  "/java-server-faces/helloWorld.php".

* Remember to stop the local backend (/etc/init.d/php-java-bridge stop) 
  and to set java.hosts=... and java.servlet=On.  Otherwise session
  sharing with .jsp will not work and java-server-faces/index.php will
  redirect you to the local backend which doesn't understand anything
  about jsf.
