Menu

[r853]: / branches / Release-2-0-7 / php-java-bridge / ABOUT.HTM  Maximize  Restore  History

Download this file

639 lines (611 with data), 25.8 kB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>Integrate PHP & Java - PHP / Java Bridge</TITLE>
	<STYLE>
	<!--
		@page { size: 21cm 29.7cm }
		P.sdfootnote { margin-left: 0.5cm; text-indent: -0.5cm; margin-bottom: 0cm; font-size: 10pt }
		A.sdfootnoteanc { font-size: 57% }
	-->
	</STYLE>
</HEAD>
<p>

</p>
<BODY LANG="en-US" DIR="LTR">
<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT ><FONT SIZE=4><B>What
is the PHP/Java bridge?</B></FONT></FONT></P>
<P><FONT > The PHP/Java bridge
  is  a PHP module which connects the PHP object system with the Java or <a href="http://www.ecma-international.org/publications/standards/Ecma-335.htm">ECMA 335</a>
  object system. It implements <A HREF="http://www.jcp.org/aboutJava/communityprocess/edr/jsr223/">JSR 223</A> (where applicable) and
  can be used to access CLR (e.g. VB.NET, C#) or Java (e.g. Java, KAWA, JRuby) based applications from PHP scripts. The PHP/Java Bridge communicates with the
  VM through local sockets using an efficient communication protocol.
  Each request-handling PHP process of a multi-process HTTP server
  communicates with a corresponding thread spawned by the VM.
  </FONT></P>
<P><FONT > Requests from more than one HTTP server may either be routed to an application server running the PHP/Java Bridge or each HTTP server may own a PHP/Java Bridge and communicate with a J2EE java application server by exchanging java value objects; the necessary client-stub classes (ejb client .jar) can be loaded at run-time.
</FONT></P>                                                                                            
<P><FONT > ECMA 335 based classes can be accessed if at least one JavaBridge.jar is running inside a ECMA complient VM, for example Novell's MONO or Microsoft's .NET.  Special features such as varargs, reflection or assembly loading are also supported. 
</FONT></P>                                                                                            
<P><FONT > Clustering and load balancing is available if the backend runs in a servlet environment supporting these features, tomcat 5 for example.
</FONT></P>                                                                                            
<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT ><FONT SIZE=4><B>How does it compare to SOAP or XML-RPC?</B></FONT></FONT></P>
<ul>
<li> The PHP/Java Bridge typically runs on the same computer as the PHP interpreter, so a very efficient protocol can be used. An example is provided which dynamically loads a java library and creates a 200x200 excel sheet using more than 40000 PHP/Java library calls.  The php example runs only 3-5 times slower than pure (jit-compiled) java code.
<li> It is not necessary to write and deploy a public interface. The bridge uses reflection to determine what can be accessed in the local backend.
<li> The PHP scripts can load/unload java libraries at runtime.
<li> On linux the c/s communication channel is not visible and the backend runs in its own "Security Enhanced Linux" domain.
<li> PHP modules such as XML-RPC do most of their work in the web-server (in C code), which makes them vulnerable to buffer overflows.  The PHP/Java Bridge module doesn't use any state on the web-server side, it simply forwards the java(...) statements to the local backend, which can communicate with the enterprise application server using RMI/IIOP or other java technologies.
</ul>
<P><FONT > 
  The bridge adds the following primitives to PHP.  The type mappings are shown in <a href="#type-mapping">table 1</a>.

<ul>
<li>
  <code>new <strong>java</strong>("CLASSNAME")</code>: References and instanciates the class CLASSNAME.
<code><strong>Java</strong></code> can also be used for <A HREF="http://www.jcp.org/aboutJava/communityprocess/edr/jsr223/">JSR 223</A> compatibility.
 After script
     execution the referenced classes may be garbage collected. Example: <br><br>
     
<blockquote>
<code>
      &lt;?php<br>
      header("Content-type: application/x-excel");<br>
      header("Content-Disposition: attachment; filename=downloaded.xls");<br>
      java_require("http://php-java-bridge.sf.net/poi.jar"); <br><br>
      
      // create a 2x2 excel sheet and return it to the client<br>
      $workbook = new java("org.apache.poi.hssf.usermodel.HSSFWorkbook");<br>
      $sheet = $workbook->createSheet("new sheet");<br>
      $style = $workbook->createCellStyle();<br>
      // access the inner class AQUA within HSSFColor, note the $ syntax.<br>
      $Aqua = new java_class('org.apache.poi.hssf.util.HSSFColor$AQUA');<br>
      $style->setFillBackgroundColor($Aqua->index);<br>
      $style->setFillPattern($style->BIG_SPOTS);<br><br>
      for($y=0; $y<2; $y++) {<br>
      &nbsp;$row = $sheet->createRow($y);<br>
      &nbsp;for($x=0; $x<2; $x++) {<br>
      &nbsp;&nbsp;$cell = $row->createCell($x);<br>
      &nbsp;&nbsp;$cell->setCellValue("This is cell $x . $y");<br>
      &nbsp;&nbsp;$cell->setCellStyle($style);<br>
      &nbsp;}<br>
      }<br><br>
      // create and return the excel sheet to the client<br>
      $memoryStream = new java ("java.io.ByteArrayOutputStream");<br>
      $workbook->write($memoryStream);<br>
      $memoryStream->close(); <br>
      echo $memoryStream->toByteArray();<br>
      ?&gt;<br>


</code>
</blockquote>
<br>
<li>
  <code>new <strong>java_class</strong>("CLASSNAME")</code>: References the class CLASSNAME without creating an instance. The object returned is the class object itself, not an object of the class.  <code><strong>JavaClass</strong></code> can also be used for <A HREF="http://www.jcp.org/aboutJava/communityprocess/edr/jsr223/">JSR 223</A> compatibility.
 After script
     execution the referenced classes may be garbage collected. Example: <br><br>
     
<blockquote>
<code>
      $Object = new JavaClass("java.lang.Object");<br>
      $obj = $Object->newInstance();<br><br>
      $Thread = new JavaClass("java.lang.Thread");<br>
      $Thread->sleep(10);<br><br>
</code>
</blockquote>
<br>
<li>
  <code><strong>java_require</strong>("JAR1;JAR2")</code>: Makes additional libraries
     available to the current script.  JAR can either be  
     a "http:", "ftp:", "file:" or a "jar:" location. On &quot;Security Enhanced Linux&quot; (<a href="README">please see the README</a>) the location must be tagged with a <em>lib_t</em> <a href="#sel">security context</a>. Example: <br><br>
<blockquote>
<code>
      $file=new java("java.io.File", "WEB_INF/web.xml");<br>
<br>
      java_require("xerces.jar;jdom.jar");<br>
      $builder = new java("org.jdom.input.SAXBuilder");<br>
      $doc = $builder-&gt;build($file);<br>
      $root = $doc-&gt;getRootElement();<br>
      $servlets = $root-&gt;getChildren("servlet");<br>
<br>
      echo "this file has " . $servlets-&gt;size() . " servlets\n";<br>
</code>
</blockquote>
<br>
<li>
  <code>$session=<strong>java_get_session</strong>(SESSIONNAME)</code>: Creates or retrieves the session SESSIONNAME. The primitive returns a session handle which can be used to store and retrieve values which survive the current script.  The session can be closed with $session->destroy(). The <code><strong>java_get_session</strong></code> shall be used before creating java instances.  It selects a node from the load balancer and then directs all further <strong><code>java</code></strong> or <strong><code>java_class</code></strong> calls to that node. If the node becomes unavailable, the session is lost and a new session is created on a different node. 

 Example:
<blockquote>
<code>
$session=java_get_session("testSession");<br>
if($session->isNew()) {<br>
&nbsp;&nbsp;  echo "new session\n";<br>
&nbsp;&nbsp;  $session->put("a", 1);<br>
&nbsp;&nbsp;  $session->put("b", 5);<br>
} else {<br>
&nbsp;&nbsp;  echo "cont session\n";<br>
}<br>
$session->put("a", $session->get("a")+1);<br>
$session->put("b", $session->get("b")-1);<br>
<br>
$val=$session->get("a");<br>
echo "session var: $val\n";<br>
<br>
if($session->get("b")==0) $session->destroy();<br>
</code>
</blockquote>
The <strong><code>java_get_session</code></strong> primitive is meant for values which <em>must</em> survive the current script.  If you want to cache data which is expensive to create, bind the data to a class.  Example:
<blockquote>
<code>
// Compile this class, create cache.jar and copy it to /usr/share/java<br>
public class Cache {<br>
&nbsp;&nbsp; public static Cache instance = makeInstance();<br>
}<br><br>
&lt;?php<br>
java_require(&quot;cache.jar&quot;);<br>
$Cache = new JavaClass(&quot;Cache&quot;);<br>
$instance=$Cache->instance; //instance will stay in the VM until the VM runs short of memory<br>
?&gt;<br>
</code>
</blockquote>
<br>
  <li> <code><strong>java_exception</strong></code>: A java exception class. Available in PHP 5 and
    above only. <code><strong>JavaException</strong></code> can also be used for <A HREF="http://www.jcp.org/aboutJava/communityprocess/edr/jsr223/">JSR 223</A> compatibility. Example:<br><br>
<blockquote>
<code>
      try {<br>
       &nbsp;&nbsp;new java("java.lang.String", null);<br>
      } catch(java_exception $ex) {<br>
&nbsp;&nbsp;         $trace = new java("java.io.ByteArrayOutputStream");<br>
&nbsp;&nbsp;         $ex-&gt;printStackTrace(new java("java.io.PrintStream", $trace));<br>
&nbsp;&nbsp;         print "java stack trace: $trace\n";<br>
      }<br>

</code>
</blockquote>
<br>
  <li> <code>foreach(COLLECTION)</code>: It is possible to iterate over values of java classes that implement java.util.Collection or java.util.Map.  Available in PHP 5 and above only. Example:<br><br>
<blockquote>
<code>
     $conversion = new java("java.util.Properties");<br>
     $conversion->put("long", "java.lang.Byte java.lang.Short java.lang.Integer");<br>
     $conversion->put("boolean", "java.lang.Boolean");<br>
     foreach ($conversion as $key=>$value) <br>
&nbsp;&nbsp;     echo "$key => $value\n";<br>
</code>
</blockquote>
<br>
  <li> <code>[index]</code>: It is possible to access elements of java arrays or elements of java classes that implement the java.util.Map interface.  Available in PHP 5 and above only.  Example:<br><br>
<blockquote>
<code>
$Array = new java_class("java.lang.reflect.Array");<br>
$String = new java_class("java.lang.String");<br>
$entries = $Array->newInstance($String, 3);<br>
$entries[0] ="Jakob der L&uuml;gner, Jurek Becker 1937--1997";<br>
$entries[1] ="Mutmassungen &uuml;ber Jakob, Uwe Johnson, 1934--1984";<br>
$entries[2] ="Die Blechtrommel, G&uuml;nter Grass, 1927--";<br>
for ($i = 0; $i < $Array->getLength($entries); $i++) { <br>
&nbsp;&nbsp;  echo "$i: " . $entries[$i] ."\n";<br>
}<br>
</code>
</blockquote>
<br>
  <li> <code><strong>java_instanceof</strong>(JAVA_OBJ, JAVA_CLASS)</code>: Tests if JAVA_OBJ is an instance of JAVA_CLASS.  Example:<br><br>
<blockquote>
<code>
$Collection=new java_class("java.util.Collection");<br>
$list = new java("java.util.ArrayList");<br>
$list->add(0);<br>
$list->add(null);<br>
$list->add(new java("java.lang.Object"));<br>
$list->add(new java("java.util.ArrayList"));<br>
foreach ($list as $value) { <br>
&nbsp;&nbsp;  if($value instanceof java && java_instanceof($value, $Collection))<br>
&nbsp;&nbsp;&nbsp;&nbsp;      /* iterate through nested ArrayList */ <br>
&nbsp;&nbsp;  else<br>
&nbsp;&nbsp;&nbsp;&nbsp;      echo "$value\n";<br>
}
<br>
</code>
</blockquote>
<br>

  <li> <code>java_last_exception_get()</code>: Returns the last exception instance or
     null. Since PHP 5 you can use <code>try/catch</code> instead.<br><br>

  <li> <code>java_last_exception_clear()</code>: Clears the error condition.  Since PHP 5 you can use <code>try/catch</code> instead.
</ul>
<br>
<A NAME="type-mapping"></A>
<center>
<B
>Table 1. Type Mappings</B
></P
>
<TABLE
BORDER="1"
><COL><COL><COL><COL><THEAD
><TR
><TH
>PHP</TH
><TH
>Java</TH
><TH
>Description</TH
><TH
>Example</TH
></TR
></THEAD
><TBODY
><TR
><TD
>object</TD
><TD
>java.lang.Object</TD
><TD
>An opaque object handle.  However, we guarantee that the first handle always starts with 1 and that the next handle is n+1 for all n < 1024 (useful if you work with the raw <a href="PROTOCOL.TXT">XML protocol</a>, see the <a href="examples/clients/README">python and scheme</a> examples).</TD
><TD
>$buf=new java("java.io.ByteArrayOutputStream");<br>
$outbuf=new java("java.io.PrintStream", $buf);<br>
</TD
></TR
><TR
><TD
>null</TD
><TD
>null</TD
><TD
>NULL value</TD
><TD
>$outbuf->println(null);</TD
></TR
><TR
><TD
>long</TD
><TD
>int</TD
><TD
>32 bit integer</TD
><TD
>$outbuf->println(100);<br>
</TD
></TR
></TR
><TR
><TD
>boolean</TD
><TD
>boolean</TD
><TD
>boolean value</TD
><TD
>
$outbuf->println(true);
</TD
></TR
><TR
><TD
>double</TD
><TD
>double</TD
><TD
>IEEE floating point</TD
><TD
>$outbuf->println(3.14);
</TD
></TR
><TR
><TD
>string</TD
><TD
>byte[]</TD
><TD
>binary data, unconverted</TD
><TD
>$bytes=$buf->toByteArray();</TD
></TR
><TR
><TD
>string</TD
><TD
>java.lang.String</TD
><TD
>An UTF-8 encoded string. Since PHP does not support unicode, all java.lang.String values are auto-converted into a byte[] (see above) using UTF-8 encoding. The encoding can be changed with the <strong><code>java_set_file_encoding()</code></strong> primitive.</TD
><TD
>$string=$buf->toString();</TD
><TR
><TD
>array (as array)</TD
><TD
>java.util.Collection or T[]</TD
><TD
>PHP4 sends and receives arrays as values.  PHP5 sends arrays as values and receives object handles which implement the new iterator and array interface.</TD
><TD
>// pass a Collection to Vector<br>
$ar=array(1, 2, 3);<br>
$v=new java("java.util.Vector", $ar);<br>
echo $v->capacity();<br><br>
// pass T[] to asList()<br>
$A=new JavaClass("java.util.Arrays");<br>
$lst=$A->asList($ar);<br>
echo $lst->size();
</TD
><TR
><TD
>array (as hash)</TD
><TD
>java.util.Map</TD
><TD
>PHP4 sends and receives hashtables as values.  PHP5 sends hashtables as values and receives object handles which implement the new iterator interface.</TD
><TD
>$h=array("k"=>"v", "k2"=>"v2");<br>
$m=new java("java.util.HashMap",$h);<br>
echo $m->size();
</TD
><TR
><TD
>JavaException</TD
><TD
>java.lang.Exception</TD
><TD
>A wrapped exception class. The original exception can be retrieved with $exception->getCause();</TD
><TD
>...<br>catch(JavaException $ex) { <br>
echo $ex->getCause();<br>
} </TD
></TR
></TBODY
></TABLE
>
</center>
<br><br>
  There is one example provided: test.php.  You can either invoke the
  test.php by typing ./test.php or copy the example into the document
  root of you web-server and evaluate the file using the browser.

</FONT></P>
<P><FONT >The PHP/Java bridge
is a replacement  for the <a href="http://www.php.net/manual/en/ref.java.php">experimental ext/java bridge</a>
shipped with PHP 4. It is not possible to run the build-in bridge and
the PHP/Java bridge at the same time.</FONT></P>
</P>
<P><FONT >
  The module has been tested on a Mandrake Linux System (Version 9.2),
  on RedHat Enterprise 3, RedHat Fedora Core 1..4, FreeBSD 5.3, Solaris 9 (Sparc, 64 bit JVM)
  and Windows with RedHat Cygwin, but it should run on all Unix-like
  operating systems.  
</FONT></P>
<P><FONT >
  Custom java libraries (.jar files) can be stored in the following
  locations:

<ol>
<li>
    Somewhere on a HTTP or FTP server, see PHP function
      java_require. <a name="sel">
On Security Enhanced Linux <code>.jar</code> files can only be loaded from locations which are tagged with the <em>lib_t</em> security context.

   <li> In the sub-directory "lib" of the PHP extension directory, if it
      exists and is accessible when the JVM starts the bridge.
      This is usually "`php-config --extension-dir`/lib".  On Security Enhanced Linux this directory is tagged with the <em>lib_t</em> security context.

   <li> In the <code>/usr/share/java/</code> directory, if it exists and is accessible
      when the JVM starts the bridge. On Security Enhanced Linux this directory is tagged with the <em>lib_t</em> security context.
</ol>
</FONT></P>
</P>
</a>
<P><FONT > The PHP/Java Bridge can operate in 4 different modes: <ol>
  <li> Invoked from the dl() function.  In this mode the bridge starts
  when the HTTP server receives a client request and terminates after the response
  is written.  This is very slow because it starts a new Java VM for
  each request. But it does not require any administrative privileges.

   <li> Permanently activated in the global php.ini file with an
 internal java process running in the HTTP server domain.  In this
 mode the bridge starts when the HTTP server starts and terminates
 when the HTTP server terminates. Recommended during
 development. Please see <a href="#mode2">web server installation
 below</a>.

   <li> Permanently activated in the global php.ini file with an
      external java process.  Recommended for <a
      href="#mode3">production systems</a>.  This mode is used by the
      RPM package available for RedHat Enterprise Linux.  In this mode
      the bridge starts and stops as a system service.

   <li> Permanently activated in the global php.ini file with an
      external <a href="#mode4">application server or servlet engine</a>.

</ol>
<P><FONT > Furthermore the PHP/Java Bridge can be: <ul> <li> Compiled
into PHP.  This is not recommended because it requires a compilation
of the entire PHP library. If you want to do this, please read the
README file.  This should only be necessary if the OS does not support
shared libraries.

   <li> Compiled with the GNU Java library.  You can either start GNU
      Java as a separate process (just like a "real" Java VM) or
      compile everything into a PHP binary.  This should only be
      necessary if there is no official JRE available for the OS or one
      doesn't want to ship a JRE with the product. 

   <li> Compiled with Novell's MONO (a ".NET" clone). This is
 currently experimental.  </ul>

</FONT></P>
<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><BR><BR>
</P>
<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT ><FONT SIZE=4><B>Installation
instructions</B></FONT></FONT></P>
<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT ><FONT SIZE=3>If
you have a RedHat Linux system (RedHat 9, RedHat Enterprise 3 or
Fedora), you can download the 32bit RPM and type <code>rpm -i
php-java-bridge-v.x.y-z-i386.rpm</code> to install it (if you run a 64bit system <strong>and</strong> a 64bit JVM you need to install the 64bit RPM instead). For other operating systems please follow 
the instructions below (on Security Enhanced Linux please use the RPM or please read the README before installation).</FONT></FONT></P>
<UL>
	<LI><P><FONT >Make sure you
	have java version 1.4 or higher, gcc 3.2 or higher, apache 1.3 or
	higher, libtool 1.4.3 or higher, automake 1.6.3 or higher, GNU make, autoconf 2.57 or higher and php 4.3.2 or higher
	installed. You can check the version numbers with the commands <code>java
	-version</code>, <code>gcc --version</code>, <code>apachectl -version</code>, <code>libtool --version</code>, <code>automake --version</code>, <code>make null --version</code>, <code>autoconf --version</code> and
	<code>php-config --version</code>. Make sure that the java version you use
	matches the kernel version. RedHat NPTL kernels or kernel &gt;= 2.6
	require either an IBMJava2, Sun Java &gt;= 1.4.2_02. For RedHat Enterprise Linux an appropriate java RPM is
	available on CD#9. </FONT> GNU Java is currently only supported on Linux and Solaris if you use the GCC 3.3.x or the upcoming GCC 4.x releases.
	</P>
	<LI><P><FONT ><FONT >Download
	the source code of the bridge from
	</FONT><A HREF="http://www.sourceforge.net/projects/php-java-bridge"><FONT >http://www.sourceforge.net/projects/php-java-bridge</FONT></A></FONT></P>
	<LI><P><FONT >Extract the file
	with the command: <code>cat php-java-bridge_v.x.y.tar.bz2 | bunzip2 |
	tar xf -</code></FONT></P>
	<LI><P STYLE="font-style: normal"><FONT >In
	the directory php-java-bridge-v.x.y build the module
	for a 32 bit JVM (if you run a 64 Bit JVM, use the <code>-m64</code> flag instead): <BR><BR><code>phpize &amp;&amp; ./configure
	--with-java=/opt/IBMJava2-14 &amp;&amp; make CFLAGS=&quot;-m32&quot;</code></FONT></P>
	<LI><P STYLE="font-style: normal"><FONT >Then
	install the module as root. Type:<BR><BR><code>su -c 'make
	install'<BR>&lt;enter password&gt;</code></FONT></P>
	<LI><P STYLE="font-style: normal"><FONT ><A name="#mode2">The PHP/Java Bridge can be run as a <strong>sub-component of the web server</strong>; add the following lines
	to the <code>php.ini</code>. Or add a file <code>java.ini</code> to the directory that contains
	the php module descriptions (usually <code>/etc/php.d/</code>) with the following
	content:<BR><BR><code>extension = java.so<BR>[java]</code></FONT></A></P>
	<LI><P STYLE="font-style: normal"><FONT >Restart
	the apache service with the command: <code>apachectl restart</code></FONT></P>
	<LI><P><FONT >You can now test
	the web installation. Copy the test.php file to the document root (usually /var/www/html) and invoke the file with your browser. You should see that the bridge module is activated and running.  The bridge starts or re-starts automatically whenever you start or re-start the web-server.
	</P>
	<LI><P><FONT ><A name="mode3">In a <strong>production environment</strong> it is recommended to separate the java VM and the HTTP process by setting the communication channel. The <code>java.socketname</code> should be set to the name of the socket, it will be created if it doesn't exist.  The <code>.ini</code> file should contain:
<BR><BR><code>extension = java.so<BR>[java]<BR>java.socketname="/var/run/.php-java-bridge_socket"</code><br><br>The advantage of this mode is that the java VM no longer depends on the web server and can be examined and re-started independently. The download file contains a script, <code>php-java-bridge.service</code>, which can be used to start/stop the PHP/Java Bridge as system service. All available <code>.ini</code> options are listed in <a href="#ini-options">table 2</a>.</A> </FONT>

	</P>
	<LI><P><FONT ><A name="mode4">In a production environment which requires <strong>load balancing and failover</strong> it is recommended deploy the backend into a servlet engine or an application server which supports these features, tomcat 5 for example. Disable the <code>java.socketname</code>, enable the <code>java.hosts</code> and <code>java.servlet</code> options and start the application server. The <code>.ini</code> file should contain:
<BR><BR><code>extension = java.so<BR>[java]<br>
java.hosts=&quot;127.0.0.1:8080&quot<br>
java.servlet="On"
</code><br><br>

</A> </FONT>

	</P>
</UL>
<A NAME="ini-options"></A>
<center>
<B
>Table 2. <code>.ini</code> options</B
></P
>
<TABLE
BORDER="1"
><COL><COL><COL><COL><THEAD
><TR
><TH
>Name</TH
><TH
>Default</TH
><TH
>Description</TH
><TH
>Example</TH
></TR
></THEAD
><TBODY
><TR
><TD
>java.java_home</TD
><TD
>compile time option.</TD
><TD
>The java installation directory.</TD
><TD
>java.java_home="/opt/jdk1.5"</TD
></TR
><TR
><TD
>java.java</TD
><TD
>compile time option.</TD
><TD
>The java executable.</TD
><TD
>java.java="/opt/jdk1.5/jre/bin/java"
</TD
></TR
><TR
><TD
>java.socketname</TD
><TD
>/var/run/.php-java-bridge_socket</TD
><TD
>The name of the communication channel for the local backend. Must be an integer on windows.</TD
><TD
>java.socketname="9167"
</TD
></TR
><TR
><TD
>java.log_level</TD
><TD
>1</TD
><TD
>The log level from 0 (log off) to 4 (log debug).</TD
><TD
>java.log_level="3"</TD
></TR
><TR
><TD
>java.log_file</TD
><TD
>/var/log/php-java-bridge.log</TD
><TD
>The log file for the local PHP/Java Bridge backend.</TD
><TD
>java.log_file="/tmp/php-java-bridge.log"</TD
><TR
><TD
>java.hosts</TD
><TD
>&lt;none&gt;</TD
><TD
>Additional bridge hosts which are used when the local backend is not available.</TD
><TD
>java.hosts="127.0.0.1:9168;127.0.0.1:9169"
</TD
><TR
><TD
>java.servlet</TD
><TD
>Off</TD
><TD
>The communication protocol. If set to "On", the bridge uses HTTP to communicate with the <code>java.hosts</code> backends.</TD
><TD
><code>;; Make sure that this option is only set <br>;; if your backend 
is deployed in a<br>;; servlet engine or application server.</code><br>
java.servlet="On"
</TD
><TR
><TD
>java.classpath</TD
><TD
> compile time option.</TD
><TD
>The java classpath. <em>Please do not change the default value</code></TD
><TD
>java.classpath="/tmp/myJavaBridge.jar:/tmp/myCasses/"<br>
</TD
></TR
></TR
><TR
><TD
>java.libpath</TD
><TD
>compile time option.</TD
><TD
>The directory which contains the <code>natcJavaBridge.so</code> used for local ("unix domain") sockets. <em>Please do not change the default value.</em></TD
><TD
>
java.libpath="/tmp/"
</TD
></TR
></TBODY
></TABLE
>
</center>
<br><br>
<P><FONT >For further
information please read the <a href="README">README</a>, <a href="INSTALL">INSTALL</a> and <a href="INSTALL.WINDOWS">INSTALL.WINDOWS</a> documents contained in
the download files.<p>
</FONT></P>
<P><BR><BR>
</P>

</P>
<P STYLE="margin-top: 0.42cm; page-break-after: avoid"><FONT ><FONT SIZE=4><B>Related</B></FONT></FONT></P>
<P><FONT >
<ul>
<li> <a href="http://zez.org/article/articleview/26/">A tutorial how to use the predecessor &quot;ext/java&quot;</a>.
<li> <a href="http://www.zend.com/store/products/zend-platform/java.php">A commercial bridge which uses the same technology as the PHP/Java Bridge</a>.
<li> <a href="http://www.devx.com/Java/Article/21707">Calling Enterprise Java Beans from PHP/SOAP</a>.
<li> <a href="http://cvs.sourceforge.net/viewcvs.py/php-java-bridge/php-java-bridge/examples/j2ee/README?rev=1.4&view=markup">Calling Enterprise Java Beans from the PHP/Java Bridge</a>.
</FONT></P>

</BODY>
</HTML>
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.