PHP and Java support errors.

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!

Moderator: General Moderators

Post Reply
ac1d
Forum Newbie
Posts: 2
Joined: Sun May 23, 2004 2:51 am

PHP and Java support errors.

Post by ac1d »

Ok, I am having a small problem with the java extension for php 4.3.6 on debian unstable with apache 1.3.29 and j2re 1.4.2.

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.so
When I try to run the following test script:

Code: 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"; }
?>

?>
I get this error:
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
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.
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!
ac1d
Forum Newbie
Posts: 2
Joined: Sun May 23, 2004 2:51 am

Post by ac1d »

bump
Post Reply