Menu

Tree [r851] / branches / Version-1 / php-java-bridge /
 History

HTTPS access


File Date Author Commit
 examples 2005-02-03 jost2345 [r135] Release-1.0.8
 server 2005-02-03 jost2345 [r135] Release-1.0.8
 tests.m4 2005-02-03 jost2345 [r137] add realtime lib for solaris x86
 tests.php5 2005-02-02 jost2345 [r134] tests
 unsupported 2005-01-28 jost2345 [r123] Release-1.0.8
 ChangeLog 2005-02-05 jost2345 [r142] *** empty log message ***
 INSTALL 2005-02-04 jost2345 [r141] Release-1.0.8
 LICENSE 2004-10-18 jost2345 [r54] correct author
 Makefile.frag 2005-02-03 jost2345 [r135] Release-1.0.8
 README 2005-02-03 jost2345 [r135] Release-1.0.8
 README.GNU_JAVA 2005-01-28 jost2345 [r123] Release-1.0.8
 VERSION 2004-12-12 jost2345 [r109] secure mode
 bind.c 2005-01-29 jost2345 [r128] *** empty log message ***
 client.c 2005-02-04 jost2345 [r141] Release-1.0.8
 config.m4 2005-02-03 jost2345 [r135] Release-1.0.8
 init_cfg.c.in 2005-01-06 jost2345 [r120] Release-1.0.8
 java.c 2005-02-04 jost2345 [r141] Release-1.0.8
 java_bridge.c 2005-01-28 jost2345 [r123] Release-1.0.8
 java_bridge.h 2005-01-02 jost2345 [r111] ZTS
 php-java-bridge 2005-01-28 jost2345 [r123] Release-1.0.8
 php-java-bridge.fc.in 2005-02-03 jost2345 [r135] Release-1.0.8
 php-java-bridge.service 2004-12-01 jost2345 [r105] release 1.0.7
 php-java-bridge.spec 2005-02-05 jost2345 [r142] *** empty log message ***
 php-java-bridge.te 2005-02-05 jost2345 [r142] *** empty log message ***
 php_java.h 2005-01-28 jost2345 [r123] Release-1.0.8
 php_wrapper.h 2004-12-01 jost2345 [r105] release 1.0.7
 protocol.h 2004-12-01 jost2345 [r105] release 1.0.7
 proxyenv.c 2004-12-20 jost2345 [r110] use java security instead of dropping the proce...
 sio.c 2004-11-11 jost2345 [r90] win32/mingw
 sio.h 2004-11-11 jost2345 [r90] win32/mingw
 test.php 2005-01-28 jost2345 [r123] Release-1.0.8
 update_policy.sh.in 2005-02-03 jost2345 [r135] Release-1.0.8

Read Me

  Using GNU Java
  --------------

  In case you don't want to ship a JVM or JRE with your product,
  you can use GNU gcc to compile the java part and your classes
  into native code. 
  In the directory php-java-bridge_1.x.y type:

   gcj --version  # must be gcj 3.3.3 or above.

   phpize && ./configure && make &&  su -c "make install"

  This creates a native, dynamic linked executable in the PHP
  extension directory.  It can be started with the command:

      `php-config --extension-dir`/java <java.socketname> <loglevel> <log-file>

  For example:

      `php-config --extension-dir`/java /var/run/.php-java-bridge_socket 1 "" |
        tee /var/log/php-java-bridge.log

  Then direct the bridge to the server-socket by hard-coding the
  java.socketname to /var/run/.php-java-bridge_socket (as described
  in the install instructions) and re-start the apache service.

  If you now invoke the test.php file, you should see the
  output from GNU Java (e.g.):

   ./test.php | fgrep java.vendor
     java.vendor -> Free Software Foundation, Inc.
     java.vendor.url -> http://gcc.gnu.org/java/

  GNU gcc is a "ahead of time" compiler. That means that classes
  which are added after compilation must be interpreted by the
  GNU java interpreter.  There's no "just in time" compiler.
  To compile your classes with the java executable you can append 
  the classes, java or jar files at the end of the java_SOURCES
  line of the server/Makefile.am.  For example:
    
  java_SOURCES= java.c JavaBridge.java my_file.java

  Then type "make install" to re-install the binary. 

  If you want to compile the server part as a separate component;
  the server sub-directory is driven by autoconf and has been
  configured with the command:

     sh autogen.sh
     dir=../modules
     ./configure --with-java --libdir=$dir --datadir=$dir --bindir=$dir

  After you have created the executables you can distribute the 
  contents of the php-java-bridge-x.y.z/modules directory. It
  should contain the files "java", "libnatcJavaBridge.so", "java.so"
  (autoconf/libtool creates other files, you can delete them). The
  java.so is the PHP module, the other files are required to start the
  server part.  The "java" executable may need other system libraries, 
  for example "gcj.so" and "gcc_s.so". They should be installed on the 
  target system.

  Additional shared libraries can be copied into the php extension
  directory (see command "php-config --extension-dir"), additional
  java libraries (.jar files) can be installed in the sub-directory
  lib/ of the php extension directory.

  GNU Java still has some limitations.  Because the SUN java classes
  are not free software, all GNU java classes had to be written from
  scratch.  It may happen that the GNU java classes contain bugs or
  have certain limitations.  For example con.getContentLength()
  constantly returns -1; length not available.
   
  However, GNU java is already good enough to be used as a bridge
  between PHP and the "real" java application server such as BEA
  WebLogic. It can be used to implement the presentation- and,
  depending on the project, even the service layer.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.