httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlo Valente" <ca...@bluonline.it>
Subject [users@httpd] apache and php+java
Date Mon, 28 Jul 2003 10:13:25 GMT

Hi all,

I have a problem I've never seen before.

Onto a fresh installation of a slackware 9.0 (all patches applied), I
installed apache with php and the java extension (for php)
this is the software I installed after the slackware installation:

mysql-4.0.13
freetype-2.1.4, gd-2.0.8, libpng-1.2.5, zlib-1.1.4
openssl-0.9.7b
mod_ssl-2.8.14-1.3.27

apache_1.3.27
mod_auth_mysql
php-4.3.2

ZendOptimizer-2.1.0b-Linux_glibc21-i386

 j2sdk1.4.1_03


PHP is configured, and compiled with the following options:

./configure \
   --with-mysql=/usr/local/mysql \
   --with-apxs=/usr/local/apache/bin/apxs \
   --enable-track-vars \
   --with-gd=/usr/local \
   --with-jpeg-dir=/usr/local \
   --with-png-dir=/usr/local \
   --with-zlib-dir=/usr/local \
   --enable-ftp \
   --disable-debug \
   --with-freetype-dir=/usr/local \
   --with-t1lib=/usr/local \
   --enable-gd-native-ttf \
   --with-java=/usr/local/j2sdk1.4.1_03 \
--enable-calendar \
--enable-safe-mode=no \
--enable-trans-sid \
--enable-track-vars=yes \
--enable-magic-quotes=yes \
--enable-bcmath=yes \
--enable-memory-limit=no \
--enable-versioning \
--enable-shared \
--disable-display-source \
--with-dom \
--with-gettext \
--enable-mbstr-enc-trans \
--enable-mbstring \
--with-iconv \
--with-bz2 \
--with-zlib \
--with-curl \
--enable-sockets \
--with-openssl


for the ssl support, I installed openssl, first, then mod_ssl then apache,
but I noticed that the modules where not compiled as dso, so I recompiled
apache like this:

./configure --prefix=/usr/local/apache \
   --enable-shared=max \
   --enable-module=ssl \
   --enable-module=rewrite

all worked fine.

now I start apache like this

/usr/local/apache/bin/apachectl start

in rc.httpd I added:

export
LD_LIBRARY_PATH=/usr/local/j2sdk1.4.1_03/jre/lib/i386:/usr/local/j2sdk1.4.1_
03/jre/lib/i386/server

otherwise php does not find java

Now, apache works fine, serves all pages and php works ok, but when I access
a php script that uses java, I mean this:

<?php

   // get instance of Java class java.lang.System in PHP
   // This is from the Java Manual
   $system = new Java('java.lang.System');

   // demonstrate property access
   print 'Java version = '.$system->getProperty('java.version').' <br>';
   print 'Java vendor = ' .$system->getProperty('java.vendor').'  <br>';
   print 'OS = '.$system->getProperty('os.name').' '.
               $system->getProperty('os.version').' on '.
               $system->getProperty('os.arch').' <br>';

   // java.util.Date example
   $formatter = new Java('java.text.SimpleDateFormat',
                         "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz");

   print $formatter->format(new Java('java.util.Date'));
 ?>

before accessing the script, httpd processes where:

 583 ?        S      0:00 /usr/local/apache/bin/httpd
 584 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 597 ?        S      0:00  |   \_ /usr/local/apache/bin/httpd
 598 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 599 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 600 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 601 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 602 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 603 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 604 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 605 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd


and after loading the php script:


 583 ?        S      0:00 /usr/local/apache/bin/httpd
 584 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 597 ?        S      0:00  |   \_ /usr/local/apache/bin/httpd
 598 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 599 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 600 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 601 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 602 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 603 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 604 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 605 ?        S      0:00  |       \_ /usr/local/apache/bin/httpd
 585 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 586 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 587 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 588 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 594 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 595 ?        S      0:00  \_ /usr/local/apache/bin/httpd
 596 ?        S      0:00  \_ /usr/local/apache/bin/httpd


if I access the script gain, of another script containing java code, the
number of httpd processes goes up

Apache logs does not say anything.

The script output is correct:


Java version = 1.4.1_03
Java vendor = Sun Microsystems Inc.
OS = Linux 2.4.21 on i386
Monday, July 28, 2003 at 11:38:45 AM Central European Summer Time




If I lauch the script like this
/usr/local/bin/php  /web/php_java.php
I get this:

****************
Another exception has been detected while we were handling last error.
Dumping information about last error:
ERROR REPORT FILE = (N/A)
PC                = 0x0x40872ebe
SIGNAL            = 11
FUNCTION NAME     = JVM_NativePath
OFFSET            = 0x5E
LIBRARY NAME      = (N/A)
Please check ERROR REPORT FILE for further information, if there is any.
Good bye.
Aborted

Any idea?

thanks, ciao




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message