PHP with Java Support
| From: | Kenny H Klatt | Date: | Wed, 25 Oct 2000 18:19:45 +0000 |
| Subject: | PHP with Java Support | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-468@lists.php.net to get a copy of this message | ||
Hello:
New to PHP, and perhaps has is a simple solution. My environment is
Linux 6.2 (Redhat) and apache 1.3.12. I have tried to build Java support in
PHP 4.03p1 using the following configure options:
./configure --with-apache=/tmp/apache_1.3.12 \
--with-gd \
--with-jpeg-dir=/usr/local/bin \
--enable-force-cgi-redirect\
--enable-discard-path \
--enable-calendar \
--enable-sigchild \
--with-java=/opt/jdk118 \
--with-ldap=/usr/local/etc/openldap \
--with-oci8=/opt/oracle/product/8.1.6 \
--with-pgsql=/var/lib/pgsql \
--with-gdbm \
--with-ndbm
Apache and PHP build properly. I setup the php.ini file as follows:
[Java]
java.class.path = /opt/jdk118/lib/classes.zip:/usr/local/lib/php_java.jar
java.home = /opt/jdk118
java.library = /opt/jdk118/lib/classes.zip
java.library.path = .\
Several other test pages run fine (basic PHP operation), but any java
reference fails with: Fatal error: Cannot instantiate non-existent class: java
in /home/httpd/html/phpdev/java.php on line 11. Having never setup PHP and java
before, does anyone see the obvious error? java.php contains:
<HTML>
<HEAD>
<TITLE>Java</TITLE>
</HEAD>
<BODY>
<?
/*
** Adapted from Sam Ruby's example
*/
//get version of Java
$system = new Java("java.lang.System");
print("Java version: " .
$system->getProperty("java.version") .
"<BR>\n");
//
// print formatted date
$formatter = new Java("java.text.SimpleDateFormat",
"EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz");
print($formatter->format(new Java("java.util.Date")) .
"<BR>\n");
?>
</BODY>
</HTML>
Kenny Klatt
University of Wisconsin - Milwaukee