Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2002 19:56:25 +0100
From:      "tm" <thomas.may@x9media.com>
To:        <freebsd-questions@FreeBSD.ORG>
Subject:   php4 + java/ext on freebsd4.4
Message-ID:  <002301c1a1e4$29296a40$0100a8c0@tm1>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi,

i installed the following ports on freebsd4.4:
mysql323-server, apache13-modssl, mod_php4 port, jdk(1.1.8)

and want to have php java/ext support. I added the following lines in the configure.php
script of the mod_php4 port.
------------------------------------------------------------------------------------------
JAVA            "Java Support" ON \

\"JAVA\")
echo "CONFIGURE_ARGS+=--with-java=/usr/local/jdk1.1.8"
;;
------------------------------------------------------------------------------------------
my php.ini script:

extension=libphp_java.so
[Java]
java.class.path = /usr/local/lib/php/php_java.jar
java.home = /usr/local/jdk1.1.8
java.library = /usr/local/lib/php/20010901/libphp_java.so
java.library.path = /usr/local/lib/php
------------------------------------------------------------------------------------------
my javatest.php programm:

<?php

  $system = new Java("java.lang.System");
  print "Java version=".$system->getProperty("java.version")." <br>\n";
  print "Java vendor=".$system->getProperty("java.vendor")." <p>\n\n";
  print "OS=".$system->getProperty("os.name")." ".
              $system->getProperty("os.version")." on ".
              $system->getProperty("os.arch")." <br>\n";

  $formatter = new Java("java.text.SimpleDateFormat","EEEE,
        MMMM dd, yyyy 'at' h:mm:ss a zzzz");
  print $formatter->format(new Java("java.util.Date"))."\n";

?>
------------------------------------------------------------------------------------------

I got the following error in the browser window:

Fatal error: Cannot instantiate non-existent class: java in /usr/local/www/data.default/javatest.php on line 3

Any idea ?
regards thomas


[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>i installed the following ports on 
freebsd4.4:</FONT></DIV>
<DIV><FONT face=Arial size=2>mysql323-server, </FONT><FONT face=Arial 
size=2>apache13-modssl, </FONT><FONT face=Arial size=2>mod_php4 port, 
jdk(1.1.8)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>and want to have php java/ext support. I added the 
following lines in the configure.php</FONT></DIV>
<DIV><FONT face=Arial size=2>script of the mod_php4 port.</FONT></DIV>
<DIV><FONT face=Arial 
size=2>------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial 
size=2>JAVA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"Java Support" ON \<BR></FONT><FONT face=Arial size=2></FONT></DIV>
<DIV><FONT face=Arial size=2>\"JAVA\")<BR>echo 
"CONFIGURE_ARGS+=--with-java=/usr/local/jdk1.1.8"<BR>;;<BR>------------------------------------------------------------------------------------------</DIV></FONT>
<DIV><FONT face=Arial size=2>my php.ini script:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>extension=libphp_java.so<BR>[Java]<BR>java.class.path = 
/usr/local/lib/php/php_java.jar<BR>java.home = 
/usr/local/jdk1.1.8<BR>java.library = 
/usr/local/lib/php/20010901/libphp_java.so<BR>java.library.path = 
/usr/local/lib/php<BR>------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>my javatest.php programm:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&lt;?php</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; $system = new 
Java("java.lang.System");<BR>&nbsp; print "Java 
version=".$system-&gt;getProperty("java.version")." &lt;br&gt;\n";<BR>&nbsp; 
print "Java vendor=".$system-&gt;getProperty("java.vendor")." 
&lt;p&gt;\n\n";<BR>&nbsp; print "OS=".$system-&gt;getProperty("os.name")." 
".<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$system-&gt;getProperty("os.version")." on 
".<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$system-&gt;getProperty("os.arch")." &lt;br&gt;\n";</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; $formatter = new 
Java("java.text.SimpleDateFormat","EEEE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
MMMM dd, yyyy 'at' h:mm:ss a zzzz");<BR>&nbsp; print $formatter-&gt;format(new 
Java("java.util.Date"))."\n";</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>?&gt;<BR>------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I got the following error in the browser 
window:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><FONT size=3><FONT 
face="Times New Roman"><STRONG>Fatal error</STRONG>: Cannot instantiate 
non-existent class: java in <B>/usr/local/www/data.default/javatest.php</B> on 
line <B>3</B></FONT></FONT></FONT></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>Any idea ?</DIV>
<DIV>regards thomas</DIV>
<DIV><FONT face=Arial size=2><STRONG><FONT face="Times New Roman" 
size=3></FONT></STRONG>&nbsp;</DIV></FONT></FONT></DIV></BODY></HTML>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002301c1a1e4$29296a40$0100a8c0>