PDA

View Full Version : Integrating php with java



shivani
August 2nd, 2007, 07:50 AM
I am not able to run my php files from the browser which uses java classes its give me error that java class not found. I am using ubuntu 7.04 and installed
java version "1.6.0"

and I configured my eclipse for java 1.6 and also I configured my jvm for java version 1.6 .Although I am not getting any problem in running java program from eclipse but I am getting problem in running php files from the browser.

The error I am getting is as Fatal error: Class 'Java' not found in /var/www/phpinfotest.php the code I am using is as

$system = new java('java.lang.System');

can any one help me out where the probl;em exactly is

shivani

nitro_n2o
August 2nd, 2007, 08:01 AM
do you have the PECL extension for php?

shivani
August 3rd, 2007, 12:41 PM
how to know PECL is installed or not and what is the use of it.
here one more thing I wan to mention that tomcat is not installed on my system and I am using the tomcat of server .Only apache is installed on my system

nitro_n2o
August 3rd, 2007, 05:38 PM
I haven't done Java with PHP integration i just know some people doing this
this is about pecl
http://pecl.php.net/
I'll ask some questions/find resources and get back to you


here is a more details explanation http://www.phpbuilder.com/manual/en/ref.java.php

dootzky
August 6th, 2007, 08:14 AM
hi people, i was having the same problem, and i solved it ALL with only one click installation.

it's called php-java bridge.

great stuff. saves me a lot of effort, and further more, it's compile time is 10 times faster, and more reliable, or at least the authors say so :)

ok, here's the link:
http://php-java-bridge.sourceforge.net/pjb/

hope to help someone :)
ch33rzs.

:guitar:

Sailme
April 27th, 2012, 01:47 AM
Apart from PHP java bridge you can also use web services to exchange data. Use localhost for performance purpose facejar (http://www.facejar.com) uses the same technique.