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> </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> </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
"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> </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> </DIV>
<DIV><FONT face=Arial size=2><?php</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> $system = new
Java("java.lang.System");<BR> print "Java
version=".$system->getProperty("java.version")." <br>\n";<BR>
print "Java vendor=".$system->getProperty("java.vendor")."
<p>\n\n";<BR> print "OS=".$system->getProperty("os.name")."
".<BR>
$system->getProperty("os.version")." on
".<BR>
$system->getProperty("os.arch")." <br>\n";</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> $formatter = new
Java("java.text.SimpleDateFormat","EEEE,<BR>
MMMM dd, yyyy 'at' h:mm:ss a zzzz");<BR> print $formatter->format(new
Java("java.util.Date"))."\n";</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>?><BR>------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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> </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> </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> </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>
