enable java support in php

Problems with the Windows version of XAMPP, questions, comments, and anything related.

enable java support in php

Postby hquijanog » 27. August 2009 19:11

Hi!, I have installed the 1.7.2 version of xampp for windows. Everything is working fine. Nevertheless, I need to add a java support in php.

I added the following lines in php.ini file

[Java]
java.home = C:\Archivos de programa\Java\jdk1.6.0_16\bin
java.library = C:\Archivos de programa\Java\j2re1.4.2_03\bin\client\jvm.dll
java.library.path = C:\Archivos de programa\Java\j2re1.4.2_03\lib

but its not working as it should because in the phpinfo() I dont get the java info and if a I run a php web page I get the following error: Fatal error: Class 'Java' not found in C:\xampp\htdocs\PhpTest3\index.php on line 10

To use java class in the php, I'm using the follogin code:
<?php
$system = new Java("java.lang.System");
echo "<P>Java version = " . $system->getProperty("java.version") . "<br>";
echo "Java vendor = " . $system->getProperty("java.vendor") . "</p>";
?>

Could someone help me to add the java support? Thanks in advance.
hquijanog
 
Posts: 2
Joined: 27. August 2009 19:03

Re: enable java support in php

Postby Wiedmann » 27. August 2009 19:51

I added the following lines in php.ini file ... but its not working as it should

Did you also have installed and enabled the PHP Java extension?

What you have done, is just adjusting 3 runtime configuration settings for this extension (if the extension is loaded).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: enable java support in php

Postby hquijanog » 27. August 2009 23:07

Hi!

I had no idea that I needed to install that, I thought that was included in the wampp and only needed to configure it (I'm newbie in php, lol). The only php java extension that I found for php 5.3.0 was this: http://php-java-bridge.sourceforge.net/pjb/ Nevertheless, I couldn't found how properly install it or configure it.

Is there any other php java extension that you recommend me or that one is the best? Besides, could you guide where to download it and install it? The information in the bridge.sourceforge was very confusing for me.
hquijanog
 
Posts: 2
Joined: 27. August 2009 19:03


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 105 guests