PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have tried to install php java components, but no luck I have tried both j2sdk1.4.2_12 as well as jdk1.1.8 and no luck!
php.ini
<?php
$system_inst = new Java('java.lang.System');
// Test PHP's ability to get a property from a Java class
echo "The version of Java running is" . $system_inst->getProperty("java.version") ;
?>
<?php
$systemInfo = new Java("java.lang.System");
print "Total seconds since January 1, 1970:
".$systemInfo->currentTimeMillis();
?>
If anyone has this working I'd appreciate any help.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by fitchic77 on Sat Oct 16, 2010 11:30 am, edited 1 time in total.
?? I was reading about it and was having trouble figuring it out....
I don't want to stress you out especially when you are helping me!!! =) ...so my sincere apologies...
Regarding phpinfo(), I don't see any java anything listed.
In my php.ini file, I have enabled the extension=php_java.dll which is in my PHP extensions folder (c:\php\ext) along with the rest.
What do I have to do to get java installed. From all the reading it was:
1) extension=php_java.dll in the php.ini
2) Installed java sdk
3) enter in php.ini
[Java]
java.library.path = "C:\php\ext"
java.class.path = "C:\php\ext\php_java.jar"
java.home = "C:\jdk1.1.8\bin"
java.library = "C:\j2sdk1.4.2_12\jre\bin\server\jvm.dll"
What am I missing then.
Last edited by fitchic77 on Sat Oct 16, 2010 11:30 am, edited 1 time in total.
java
Directive Local Value Master Value
java.class.path C:\php\ext\php_java.jar C:\php\ext\php_java.jar
java.home C:\j2sdk1.4.2_12\jre\bin C:\j2sdk1.4.2_12\jre\bin
java.library c:\php\ext;C:\j2sdk1.4.2_12\jre\bin\server\jvm.dll c:\php\ext;C:\j2sdk1.4.2_12\jre\bin\server\jvm.dll
java.library.path C:\php\ext C:\php\ext
And this is the error from my javatest.php
Fatal error: java() [<a href='function.java'>function.java</a>]: Unable to load Java Library c:\php\ext;C:\j2sdk1.4.2_12\jre\bin\server\jvm.dll, error: The specified module could not be found. in C:\Program Files\Apache Group\Apache2\htdocs\test\sterling\javatest.php on line 2
I've also tried C:\j2sdk1.4.2_12\jre\bin\client\jvm.dll AND no go...
Stumped!!
Last edited by fitchic77 on Sat Oct 16, 2010 11:30 am, edited 1 time in total.