Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 08:06:33 +0100
From:      "nn" <thomas.may@x9media.com>
To:        <ports@freebsd.org>
Subject:   mod_php4 port with java/ext support !
Message-ID:  <000001c1ae13$a82456d0$8c00a8c0@tm>

Next in thread | Raw E-Mail | Index | Archive | Help
This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C1AE1C.09E8BED0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi there,
 
i tried to get the java/ext functions enabled in the /www/mod_php4 port.
On FreeBSD 4.5 first i installed the /java/linux-jdk1.3.1,
/databases/myqsl323-server and /www/apache13_modssl port.
 
Then i have yust done a little change in the configure.php script.
------------------------------------------------------------------------
---------------------------
# /usr/ports/www/mod_php4/scripts/configure.php
JAVA            "Java Support" ON \
\"JAVA\")
echo "CONFIGURE_ARGS+=--with-java=/usr/local/linux-jdk1.3.1"
;;
------------------------------------------------------------------------
---------------------------
# /.chrc (set the enviroment variables):
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin
/usr/local/bin /usr/X11R6/bin $HOME/bin /usr/local/linux-
jdk1.3.1/bin)
setenv  CLASSPATH
/usr/local/linux-jdk1.3.1/lib/tools.jar:/home/thomas/javaprg
setenv  JAVA_HOME /usr/local/linux-jdk1.3.1
------------------------------------------------------------------------
---------------------------
# /usr/local/etc/php.ini (my php.ini section)
[java]
 java.class.path = /usr/local/lib/php/php_java.jar
 java.home = /usr/local/linux-jdk1.3.1
 java.library = /usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot/libjvm.so
 extension_dir = /usr/local/lib/php/20010901
 extension = libphp_java.so
------------------------------------------------------------------------
---------------------------
/usr/local/www/data.default/phpjavatest3.php (this is my testprogram)
<?php
$systemInfo = new Java("java.lang.System");
print "Total seconds since January 1, 1970:
".$systemInfo->currentTimeMillis();
?>
------------------------------------------------------------------------
---------------------------
This is my error:
Fatal error: Unable to load Java Library
/usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot/libjvm.so, error: Shared
object "libnsl.so.1" not found in
/usr/local/www/data.default/phpjavatest3.php on line 2
 
I read that posting on php.net from magnus, could it be a solution, what
must i do ?
 
An _very_ important thing here is to remember that the apache must be
linked with pthreads (do "LDFLAGS=-lpthread ./configure
<options>", or like me, add it the the .spec file).
You can check if your apache is pthreaded with "ldd $(which
httpd)" if you like.
I experianced a lot of hangs/errors due to this problem, it's a shame
that
it's not in the docs / README (i didn't find it).
 
It would be great to have java/ext support in futher versions of
mod_php4.
best regards
thomas from berlin
 
 
 

------=_NextPart_000_0001_01C1AE1C.09E8BED0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">;

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C1AE1C.0616CF40">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
pre
	{margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:Courier;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Courier New";
	color:black;}
span.EmailFormatvorlage17
	{mso-style-type:personal-compose;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:windowtext;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Normale Tabelle";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DDE link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:35.4pt'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>Hi =
there,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>i tried to get the =
java/ext
functions enabled in the /www/mod_php4 port. On FreeBSD 4.5 first i =
installed
the /java/linux-jdk1.3.1, /databases/myqsl323-server and =
/www/apache13_modssl
port.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>Then i have yust done =
a
little change in the configure.php script.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>-----------------------=
-------------------------------------------------------------------------=
---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>#
/usr/ports/www/mod_php4/scripts/configure.php<o:p></o:p></span></font></p=
>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'>JAVA<span
style=3D'mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;
</span>&quot;Java Support&quot; ON \<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'>\&quot;JAVA\&quot;)<o:p></o:p></s=
pan></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>echo
&quot;CONFIGURE_ARGS+=3D--with-java=3D/usr/local/linux-jdk1.3.1&quot;<o:p=
></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>;;<o:p></o:p></span></f=
ont></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>-----------------------=
-------------------------------------------------------------------------=
---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'># /.chrc (set the =
enviroment
variables):<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>set path =3D (/sbin /bin /usr/sbin /usr/bin =
/usr/games /usr/local/sbin
/usr/local/bin /usr/X11R6/bin $HOME/bin =
/usr/local/linux-<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>jdk1.3.1/bin)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>setenv<span style=3D'mso-spacerun:yes'>&nbsp; =
</span>CLASSPATH
/usr/local/linux-jdk1.3.1/lib/tools.jar:/home/thomas/javaprg<o:p></o:p></=
span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>setenv<span
style=3D'mso-spacerun:yes'>&nbsp; </span>JAVA_HOME =
/usr/local/linux-jdk1.3.1<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'>---------------------------------=
------------------------------------------------------------------<o:p></=
o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'># /usr/local/etc/php.ini (my =
php.ini
section)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'>[java]<o:p></o:p></span></font></=
p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'><span
style=3D'mso-spacerun:yes'>&nbsp;</span>java.class.path =3D
/usr/local/lib/php/php_java.jar<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DFR =
style=3D'font-size:10.0pt;
font-family:Arial;mso-ansi-language:FR'><span
style=3D'mso-spacerun:yes'>&nbsp;</span></span></font><font size=3D2 =
face=3DArial><span
lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>java=
.home
=3D /usr/local/linux-jdk1.3.1<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><span
style=3D'mso-spacerun:yes'>&nbsp;</span>java.library =3D
/usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot/libjvm.so<o:p></o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><span
style=3D'mso-spacerun:yes'>&nbsp;</span>extension_dir =3D
/usr/local/lib/php/20010901<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><span
style=3D'mso-spacerun:yes'>&nbsp;</span>extension =3D =
libphp_java.so<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>-----------------------=
-------------------------------------------------------------------------=
---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB;mso-bidi-font-weight:bol=
d'>/usr/local/www/data.default/phpjavatest3.php
(this is my testprogram)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>&lt;?php<o:p></o:p></sp=
an></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>$systemInfo =3D new
Java(&quot;java.lang.System&quot;);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>print &quot;Total =
seconds
since January 1, 1970:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>&quot;.$systemInfo-&gt;=
currentTimeMillis();<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>?&gt;<o:p></o:p></span>=
</font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>-----------------------=
-------------------------------------------------------------------------=
---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>This is my =
error:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB;mso-bidi-font-weight:bol=
d'>Fatal
error</span></font><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'>: Unable to load Java =
Library
/usr/local/linux-jdk1.3.1/jre/lib/i386/hotspot/libjvm.so, error: Shared =
object
&quot;libnsl.so.1&quot; not found in <span =
style=3D'mso-bidi-font-weight:bold'>/usr/local/www/data.default/phpjavate=
st3.php</span>
on line <span =
style=3D'mso-bidi-font-weight:bold'>2<o:p></o:p></span></span></font></p>=


<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB;mso-bidi-font-weight:bol=
d'><o:p>&nbsp;</o:p></span></font></p>

<pre><font size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
9.0pt;font-family:Arial;mso-ansi-language:EN-GB'>I read that posting on =
php.net from magnus, could it be a solution, what must i do =
?<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span></font=
></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>An _very_ important thing =
here is to remember that the apache must =
be<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>linked with pthreads (do =
&quot;LDFLAGS=3D-lpthread =
./configure<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>&lt;options&gt;&quot;, or =
like me, add it the the .spec =
file).<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>You can check if your apache =
is pthreaded with &quot;ldd =
$(which<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>httpd)&quot; if you =
like.<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>I experianced a lot of =
hangs/errors due to this problem, it's a shame =
that<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>it's not in the docs / README =
(i didn't find it).<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span></font=
></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>It would be great to have =
java/ext support in futher versions of =
mod_php4.<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>best =
regards<o:p></o:p></span></font></pre><pre><font
size=3D1 color=3Dblack face=3DArial><span lang=3DEN-GB =
style=3D'font-size:9.0pt;
font-family:Arial;mso-ansi-language:EN-GB'>thomas from =
berlin<o:p></o:p></span></font></pre>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span=
></font></p>

</div>

</body>

</html>

------=_NextPart_000_0001_01C1AE1C.09E8BED0--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?000001c1ae13$a82456d0$8c00a8c0>