note 34046 added to ref.java
| From: | phpnet at rack1 dot php dot net | Date: | Mon, 14 Jul 2003 19:46:44 +0000 |
| Subject: | note 34046 added to ref.java | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52097@lists.php.net to get a copy of this message | ||
Red Hat Linux release 7.2 (i386)
apache 1.3.27
php 4.2.3
j2sdk1.4.2
I followed all the notes in this thread and managed to get it to work for the system described
above.
Apache kept hanging until I added pthreads to the apache build.
So all in one place the things u need to get it working for the system noted above.
It follows on from all the hard work/effort from the previous posts (thanks guys!!!),
i take no credit - this just an extra bit of help..
Apache
--------
Apache needs pthreads, you can do it before the configure command, ie:
LDFLAGS=-lpthread ./configure --prefix=/www/web1 \ etc etc
After it is installed, edit apachectl and add at the top somewhere:
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/server
I tried to add those paths to /etc/ld.so.conf (and running ldconfig -v)
but a test php page with:
echo "<PRE>";
system("ldd /usr/java/j2sdk1.4.2/jre/lib/i386/*")
showed many "not founds"
therefore I stuck with the LD_LIBRARY_PATH
ran it again and all was ok - all the libraries resolved ok.
Setting the LD_LIBRARY_PATH correctly should dissolve all errors such as:
Cannot instantiate non-existent class:
cannot open shared object file:
Unable to load Java Library
PHP
----
Compile with
--with-java=PATH_TO_JAVA_HOME
mine is:
--with-java=/usr/java/j2sdk1.4.2
php.ini settings - mod for your paths/versions
-----------------
[java]
java.class.path=/www/web1/conf/lib/php/php_java.jar
java.home = /usr/java/j2sdk1.4.2
java.library = /usr/java/j2sdk1.4.2/jre/lib/i386/libjava.so
java.library.path = /www/web1/conf/lib/php/extensions/no-debug-non-zts-20020429
extension_dir = /www/web1/conf/lib/php/extensions/no-debug-non-zts-20020429
extension=libphp_java.so
test
-----
make a test php page
just write:
<?phpinfo() ?>
then save and browse to it.
check the java section to see if your php.ini settings are set
hack
-----
Finally, in the java.library.path dir where java.so lives
run the command
ln -s java.so libphp_java.so
edit a test file with the java code in at the top of this thread and all should b ok
any errors in the error_log - check that the LD_LIBRARY_PATH is really set
sorry if i have missed anything out
mail me a slap :O)
but its been an awful day today!
G00dLucK,
ells..
----
Manual Page -- http://www.php.net/manual/en/ref.java.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34046
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34046&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34046&report=yes