Java and PHP

May 28, 2004

I tried compiling java support for PHP a couple of days ago with out much success. Yesterday I found myself on windows after sometime and decided to see try out java extension on windows. It worked like a charm, (which I found rather disappointing).

Determined to get this setup on linux I decided to visit the manual page on the php.net and read all the user contributed comments.

In case you are wondering, I did RTFM before trying out the install, some of the pages feel like old friends. However I have the manual installed locally (bandwidth is very expensive in my country) Unfortunately the local copy does not contain user contributed comments. It is in this user contributed comments that I found the solution. As always happens on unix like operating systems the solution was trivial.

All I had to do (as suggested by [phpnet AT devnull DOT org DOT uk]) was to create a symlink to java.so

ln -s java.so libphp_java.so

That's it! In case you want a peek at my php.ini file here it is

[Java]
java.class.path =/usr/lib/php4/php_java.jar
java.home = /opt/java/j2sdk1.4.2/
java.library = /opt/java/j2sdk1.4.2/jre/lib/i386/server/libjvm.so
java.library.path = /usr/lib/php4/
extension_dir=/usr/lib/php4/
extension=java.so

I have been promising myself that I will do some projects that makes full use of both PHP and Java for a long long time. Now I can get started on it.


footnote (July 09, 2004) :
The main site now has an article on this topic

Posted by raditha at May 28, 2004 10:47 PM
Your Ad Here

 

Jabber  |  Linux  |  mySQL  |  PHP  |  Java  |  Site Map  |  Wiki

Downloads  |  About  |  Links  |  Contact  |  Home

 

Copyright © Raditha Dissanayake 2003 - 2007

Terms of Use  |  Privacy

 

 

May 2004
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31