Hi, I hope someone can help..
I'm trying to get PHP 4.0.5 to work on a Cobalt RaQ3i server with Java support like so:
./configure --with-apxs=/usr/sbin/apxs --with-mysql --with-java=/usr/jdk1.2.2 --enable-track-vars
Cobalt chose to put the httpd daemon in /usr/sbin as oppose to /usr/bin so I had to create a symlink in /usr/bin for the make install to work properly (otherwise you get a nasty apxs:Warning: /usr/bin/httpd not found or not executable Continuing anyway...No shared object support for Apache available under your platform. Make sure the Apache module mod_so is compiled into your server binary `/usr/bin/httpd'. Continuing anyway...)
Once the ./configure, make, make install was done I moved the libphp_java.so and php_java.jar to the extensions directory, copied php.ini-dist to /usr/local/lib/php.ini and edited the [Java] section as so:
[Java]
java.home=/usr/jdk1.2.2
java.class.path=/usr/jdk1.2.2/jre/lib/i386/rt.jar:/usr/jdk1.2.2/jre/lib/:/usr/jdk1.2.2/jre/lib/i386:/usr/local/lib/php/extensions/php_java.jar
java.library.path=/usr/local/lib:/usr/jdk1.2.2/jre/lib/i386:/usr/jdk1.2.2/jre/lib/i386/classic:/usr/jdk1.2.2/jre/lib/i386/native_threads
java.library=/usr/jdk1.2.2/jre/lib/i386/libjava.so
extension=/usr/local/lib/php/extensions/libphp_java.so
I'm confident PHP4 is working as phpinfo gives me some useful output but there is definately something not right with the DSO/PHPJava side of things. I tried various different setups in this section to no avail... when I try and call up jver.php or anything that tries to call an instance of JVM the browser gives me a 'Website found..waiting reply..' and eventually times out. I've turned Apache logging up to debug which tells me nothing useful and PHP logging doesn't even seem to be working so not many clues as to why its toiling so much.
I've checked for the correct entries in the httpd.conf and restarted Apache after every php.ini tweak.
I have noticed that unless I specify the LD_LIBRARY_PATH from the shell and stop and start Apache I get the error message:
Fatal error: Unable to load Java Library /usr/jdk1.2.2/jre/lib/i386/libjava.so, error: libhpi.so: cannot open shared object file: No such file or directory in /webroot/jver.php on line 4
Incidentally, I did try to use the shipped JRE (Blackdown Java-Linux port of the Java 2 SDK to Linux) but when I tried to compile PHP using just --with-java=/usr it could not find the required libraries.. if I tried --with-java=/usr/jre1.2 it always tried to append /include to the path and could not find what it was looking for. So I ended up using the Sun JDK 1.2.2 and configuring with --with-java=/usr/jdk1.2.2 gives no problems at all.
I'd appreciate any input/suggestions y'all might have, I'm still working away at it and I'm sure its going to be a simple fix in the end, it usually works out that way!
Many thanks in advance
Paul Milne
ICT Consultant
Digit Limited