I compiled php with the --with-java flag and set all paths correctly in my php.ini (I think (lines below)).
Code: Select all
їJava]
java.home = /usr/java/j2re1.4.2
java.library.path = /usr/java/j2re1.4.2/lib/i386
java.library = /usr/java/j2re1.4.2/lib/i386/libjava.so
java.class.path = /usr/local/lib/php/php_java.jar
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20020429
extension = java.soCode: Select all
<?php
$fp = new Java("java.io.File", "/tmp/unpack.log");
if($fp->exists())
{
echo "The file ". $fp->getAbsolutePath() . " is ". $fp->length() . " bytes"; }
else
{
echo "The file " . $fp->getAbsolutePath() . " does not exist"; }
?>
?>The file libjvm.so exists in /usr/java/j2re1.4.2/lib/i386/client (subdirectory of library path set in php.ini) and just to be safe i made a copy in /usr/java/j2re1.4.2/lib/i386.Fatal error: Unable to load Java Library /usr/java/j2re1.4.2/lib/i386/libjava.so, error: libjvm.so: cannot open shared object file: No such file or directory in /www_relex/index.php on line 2
Could the error be in my library path or class path settings above? Or can it be something else. Thanks for all your help in advance.
PS: /tmp/unpack.log exists, so I don't think that has anything to do with it!