<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=PhpJavaIntegration</id>
	<title>PhpJavaIntegration - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=PhpJavaIntegration"/>
	<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=PhpJavaIntegration&amp;action=history"/>
	<updated>2026-04-28T23:14:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pickwiki.org/index.php?title=PhpJavaIntegration&amp;diff=2136&amp;oldid=prev</id>
		<title>Conversion script: link fix</title>
		<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=PhpJavaIntegration&amp;diff=2136&amp;oldid=prev"/>
		<updated>2015-02-26T23:48:55Z</updated>

		<summary type="html">&lt;p&gt;link fix&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[HomePage]] &amp;gt;&amp;gt; [[SourceCode]] &amp;gt;&amp;gt; [[JavaSource]] &amp;gt;&amp;gt; &amp;lt;nowiki&amp;gt;PhpJavaIntegration&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Getting PHP / Java / Universe (Unidata) to Work Together =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As PHP does not as of this date support the Universe database,&lt;br /&gt;
this is one approach to get data into your PHP application.&lt;br /&gt;
(There are also [[CreateWebInterfaces|other ways to create web interfaces]].)&lt;br /&gt;
&lt;br /&gt;
This has been tested with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Web Server:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Redhat Linux 8.0 running Apache 2.0.40&lt;br /&gt;
* Sun Java 1.4.1_01 SDK                     &lt;br /&gt;
* PHP 4.3.0&lt;br /&gt;
* Uniobjects for Java&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Universe Server:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Caldera Openunix 8.0&lt;br /&gt;
* Universe 9.6.2.1&lt;br /&gt;
&lt;br /&gt;
It also works with PHP 4.3.1, Apache 2.0.45 &amp;amp; [[UniData]] 6.0 PE on Redhat Linux 8.0&lt;br /&gt;
&lt;br /&gt;
Here are the steps I used to get this working:&lt;br /&gt;
First I will refer you to http://www.php.net to get the basic&lt;br /&gt;
stuff working.  There is also a good site at&lt;br /&gt;
http://www.onlamp.com/pub/a/php/2001/06/14/php_jav.html&lt;br /&gt;
on setting up PHP with Java. However I had to tweak it a bit to&lt;br /&gt;
get it working for me.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;i&amp;gt;An example of configuring PHP 4.3.1 to work with Apache 2.0.45 and Java 1.4.1:&amp;lt;/i&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@crisium php-4.3.1]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-java=/usr/java/j2sdk1.4.1_01 --with-apache2=/usr/httpd-2.0.45&lt;br /&gt;
[root@crisium php-4.3.1]# make &lt;br /&gt;
[root@crisium php-4.3.1]# make install &lt;br /&gt;
&lt;br /&gt;
[root@crisium httpd-2.0.45]# ./configure --enable-so&lt;br /&gt;
[root@crisium httpd-2.0.45]# make&lt;br /&gt;
[root@crisium httpd-2.0.45]# make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
My java path was: /usr/java/j2sdk1.4.1_01&lt;br /&gt;
My php module extensions are at: /usr/lib/php4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So my php.ini file used the following relevant directives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Java]&lt;br /&gt;
java.class.path=/usr/java/lib/php_java.jar:/usr/java/lib/asjava.jar:.&lt;br /&gt;
java.home=/usr/java/j2sdk1.4.1_01&lt;br /&gt;
java.library=/usr/java/j2sdk1.4.1_01/jre/lib/i386/libjava.so&lt;br /&gt;
java.library.path=/usr/lib/php4&lt;br /&gt;
&lt;br /&gt;
extension_dir = /usr/lib/php4&lt;br /&gt;
&lt;br /&gt;
extension=java.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Find the php_java.jar int the ext/java directory of the distribution&lt;br /&gt;
and place it where you want it.  I like to keep the source code free of runtime code.&lt;br /&gt;
Other than that the placement is up to you.&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There is also some weird naming of libraries going on here (remember&lt;br /&gt;
this is experimental) so you will need to go to the java.library.path (which is the location of java.so)&lt;br /&gt;
and symbolically link java.so to libphp_java.so.&lt;br /&gt;
Use &amp;#039;ln -s java.so libphp_java.so&amp;#039; to do this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You will also need to add some entries to your /etc/init.d/httpd&lt;br /&gt;
startup file: &lt;br /&gt;
&lt;br /&gt;
* [[LD_LIBRARY_PATH]]=:/usr/java/j2sdk1.4.1_01/jre/lib/i386:\/usr/java/j2sdk1.4.1_01/jre/lib/i386/server&lt;br /&gt;
* LANG=en_US.iso885915  or LANG=C&lt;br /&gt;
&lt;br /&gt;
[[LD_LIBRARY_PATH]] really is needed on Redhat8 at least. YMMV.&lt;br /&gt;
&lt;br /&gt;
The LANG=en_US.iso885915 is needed depending on what&lt;br /&gt;
your $LANG environmental variable is.  Otherwise you get weird character&lt;br /&gt;
translations with Uniobjects (thanks David T. Meeks of ascential software).&lt;br /&gt;
&lt;br /&gt;
You can test the basic functionality of this by using the examples shown&lt;br /&gt;
in the previous web sites.  Use the examples supplied here to test&lt;br /&gt;
the [[UniObjects]] for Java connectivity.&lt;br /&gt;
&lt;br /&gt;
* The php web page: [[TestMe]].php&lt;br /&gt;
* The Java test code: [[UniBean]].java&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;To your php.ini file.  put a piece of code out there with&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?php echo phpinfo(); ?&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Check the output, you should see a Java section reflecting your settings &amp;lt;/b&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
Troubleshooting:&lt;br /&gt;
&lt;br /&gt;
If you get this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fatal error: Unable to load Java Library /usr/java/j2sdk1.4.1_01/jre/lib/i386/libjava.so, &lt;br /&gt;
error: libjvm.so: cannot open shared object file: &lt;br /&gt;
No such file or directory in /usr/local/apache2/htdocs/personal.php on line 844&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The solution is:&lt;br /&gt;
Set [[LD_LIBRARY_PATH]] as described above&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any further questions, I can be reached at bill@sweye.com&lt;/div&gt;</summary>
		<author><name>Conversion script</name></author>
	</entry>
</feed>