How to integrate PHP and JAVA?

keiren09

New Member
I need an urgent help from you people.I got something very odd while trying to integrate php with java. First, my system specifications:Windows XPI have installedXAMPP server:- xampp-win32-1.6.1-installerThis install PHP, Apache, and MySQL on my system. There versions are as followsApache Version :- Apache/2.2.4 (Win32)PHP version :- 4.3.1Sun Microsystems JDK version :- jdk1.6.0_16I am achieving this PHP-JAVA extensoion using php-javabridge. I have downloaded javabridge.jar file from following url.placed the downloaded javabridge.jar file on this path C:\xampp\php\ext\Settings done in php.ini file for php-java integration are as follows.; Directory in which the loadable extensions (modules) reside. extension_dir = "C:\xampp\php\ext\"I also uncomment the java extension.extension=php_java.dllI have added following lines in Module Settings section of PHP.ini file.;;;;;;;;;;;;;;;;;;; ; Module Settings ; ;;;;;;;;;;;;;;;;;;;[Java] ;This points to the directory where your Java ;classes will be stored. You can designate multiple ;paths, each path separated by a semicolon. ;It must also include the location of php_java.jar java.class.path = "C:\xampp\php\ext\JavaBridge.jar;C:\xampp\php\extensions\php_java.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib;C:\Program Files\Java\jdk1.6.0_16;C:\prog";java.class.path = "C:\xampp\php\extensions\php_java.jar;C:\prog" ; This points to the bin directory of the JDK. java.home = "C:\Program Files\Java\jdk1.6.0_16\bin"; This must point to the Java Virtual Machine (jvm.dll) file. java.library = "C:\Program Files\Java\jdk1.6.0_16\jre\bin\server\jvm.dll"; This must point to the location of php_java.dll. java.library.path = "C:\xampp\php\ext;C:\Program Files\Java\jdk1.6.0_16\jre\lib"java.java = "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"When I start the apache server service, the program runs ok. But, if I close the browser and open it again, the program no longer runs and give me a "Fatal error: Unable to create Java Virtual Machine in C:\php\java.php ...". If I restart the apache server service, the program works again, but with the same behavior: if I close the browser window and open it again, it does not work. I checked on internet but dont get any solution but found many people facing same problem. And many of them told its a bug in PHP-JAVA bridge. So is there any solution on this problem. I ran out of options and, if anyone could help, I'll appreciate. Thank You.
 
Back
Top