Setting up Java
| From: | Davor Cengija | Date: | Fri, 17 Nov 2000 15:56:51 +0000 |
| Subject: | Setting up Java | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25915@lists.php.net to get a copy of this message | ||
Could anyone explain to me how to set up Java extensions
within PHP4? I compiled it successfully, but I cannot fix this
error:
Fatal error: Unable to locate CreateJavaVM function in
/opt/web/php4/htdocs/info.php on line 2
This is my info.php
<?php
$system = new Java("java.util.System"); // here's the error
print "Java version: " . $system->getProperty("java.version") .
"<br>\n";
?>
Configuration flags:
'./configure' '--prefix=/opt/web/php_stuff'
'--with-apxs=/opt/web/php4/bin/apxs' '--with-mysql=/usr'
'--with-pgsql=/usr' '--enable-track-vars'
'--with-config-file-path=/opt/web/php4/conf' '--with-pdflib=/opt'
'--with-gd=/opt' '--with-xml' '--with-java=/opt/java/jdk'
'--with-ldap' '--with-curl' '--with-dom=/opt'
'--enable-dbase'
'--enable-ftp' '--enable-wddx
Configured and compiled with no problems.
This is in my php.ini (part of it):
[Java]
;java.class.path = .\php_java.jar
;java.home = c:\jdk
;java.library = c:\jdk\jre\bin\hotspot\jvm.dll
;java.library.path = .\
java.class.path="/opt/java/jdk/jre/lib/rt.jar:/opt/java/jdk/lib/tools.jar:
/home/davor/proj/java:/opt/java/lib:
/mnt/test/java/lib:/opt/web/php_stuff/lib/php_java.jar"
java.home=/opt/java/jdk
java.library=/opt/web/php_stuff/lib/libphp_java.so
java.library.path=/opt/web/php_stuff/lib
extension_dir=/opt/web/php_stuff/lib
extension=libphp_java.so
(Lines are broken to fit).
phpinfo() says Java is using the options shown above.
My platform:
PHP4.03pl1 as module (--with-apxs)
Apache 1.3.12
JDK IBM 1.3.0 (same problems with Sun's JDK 1.2.2)
Mandrake Linux 7.2 (and earlier releases)
glibc 2.1.3
Kernel 2.2.16
Thanks.
--
Besplatno kopiranje Linux distribucija i softwarea
[Novi Mandrake, RedHat, Debian, ...]
http://www.inet.hr/~dcengija/