Re: Java Extension Build Method
| From: | Tony J. White | Date: | Fri, 06 Dec 2002 18:55:44 +0000 |
| Subject: | Re: Java Extension Build Method | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-92173@lists.php.net to get a copy of this message | ||
> Under the heading "Build java module with -ljava" you mention that there
> were crashing problems because libjava.so was linked agains pthread and
> apache wasn't. This is not uncommon problem for other libraries such as
> oci8. You can link apache with pthread which will prevent the segfaults. See
> oci8 manual page for instructions.
Thanks for the tip.
I built apache with -lpthread and I was able to get a little bit farther with
linking the java module with -ljava.For the first time I was able to run the
following script through apache:
http://www.tjw.org/php_java/classloader.phps
However, I had other problems that keep this build method from working right.
The code
$system = new Java('java.lang.System');
would hang apache. Why the more advanced classloader.php example worked and
this one didn't I have no idea. Both examples worked fine in the CLI
build of PHP.
I also noticed that if i create the JVM in PHP_MINIT_FUNCTION() instead of
creating it on the first request for java, apache hangs for every java
request. This works fine in the CLI build. Since I get no segfault and
strace -p gives me no output at all, I'm stumped.
-Tony