PDA

View Full Version : PHP + Java help needed


scsi
01-09-2003, 10:19 AM
Hi all,
I've an old problem about having php working in conjunction with java. Hope somone in this forum can help me on that...

On my linux box is now running php 4.3 and have been installed jdk1.3.1_06

This is section of my php.ini

[Java]

java.library=/home/java/jdk1.3.1_06/jre/lib/i386/server/libjvm.so
java.class.path=/usr/lib/php/php_java.jar
java.home=/home/java/jdk1.3.1_06
java.library.path=/usr/lib/php/extensions/no-debug-non-zts-20020429
#java.library.path = /usr/local/php-4.3.0/lib/php/20020429-zts
extension=java.so

When i try to execute javatest.php the browser start to search and remain freezed without loading the script.
Content of javatest.php is:

<?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") ;
?>

Please help me to have it working fine!!!!! Any suggestion, tutorial or other will be greatly appreciate.
I'm also ready to pay for a professional installation

firepages
01-09-2003, 11:46 AM
what flavour of linux ? I assume you have configured
--with-java=/home/java/jdk1.3.1_06

? if you run phpinfo() does it show java support enabled ?

scsi
01-09-2003, 12:16 PM
what flavour of linux....ehmmm don't know if you know cobalt raq4 (it's a redhat modified).

yes php was configured '--with-java=/home/java/jdk1.3.1_06/'

yes java support is enabled and showed in php.info

firepages
01-09-2003, 01:06 PM
try adding the relevant paths to your LD_LIBRARY_PATH , in Rodney Redhat I find that in /etc/ld.so.conf I have as so

/home/java/jdk1.3.1_06/jre/lib/i386/server/
/usr/local/php-4.3.0/lib/

else try adding the LD_LIBRARY_PATH =..blah
in /etc/init.d/httpd

I know the php.ini settings are supposed to take care of this but looking around this seems a common issue.

scsi
01-09-2003, 08:48 PM
I already tried that...and it still doesn't work


LD_LIBRARY_PATH=/home/java/jdk1.3.1_06/jre/lib/i386/server


any other solutions?
thanks