FW: [PHP4BETA] iodbc crashing while connecting to MSSQL
[email protected] (Dave Goodrich)
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <B551475B.16C2%[email protected]> |
> From: Andreas Karajannis <[email protected]> > Date: Wed, 24 May 2000 08:57:50 +0200 > To: [email protected] > Cc: [email protected] > Subject: Re: [PHP4BETA] Problem with Openlink and iODBC > > >> First when compiling php with the line "./configure >> --with-openlink=/usr/openlink --with-iodbc=/usr" >> > > Use either --with-openlink or --with-iodbc but not both. > > -Andreas Not actualy, you do in fact need both, look at the follwing HOWTO which describes the set-up fr using openlink odbc with PHP. This was sent to me by Andrew at Openlink and worked on this end. I have _other_ problems 8^( but the Openlink is working fine from PHP now. http://www.iodbc.org/odbc-phpHOWTO.html The reason you are getting the error of isql.h not being found eludes me, I installed the iodbc into default(/usr/local), I used the following config line and it was found. ./configure --with-iodbc --with-openlink=/usr/local/openlink --with-apxs=/usr/local/apache/bin/apxs --with-ttf=/usr/local/lib --with-gd=/usr/local/lib/gd1.3 FreeBSD 3.2 DAve. ---------- > From: "Andrew Hill" <[email protected]> > Reply-To: <[email protected]> > Date: Thu, 18 May 2000 14:36:11 -0400 > To: "Dave Goodrich" <[email protected]>, <[email protected]> > Subject: RE: [PHP4BETA] iodbc crashing while connecting to MSSQL > > Dave, > > IODBC is not a driver, but a driver manager. What driver are you using with > it? > > If none, than this is the problem :) This seems to be a common > misunderstanding, so I've updated the odbc-phpHOWTO to reflect this and to > give an overview of when to use --with-iodbc and when to use --with-odbc > > I've submitted a revised copy to the folks at iODBC.org, but until it show > up, I've attached the new one to this post. > > Best regards, > Andrew > ---------------------------------------------------- > Andrew Hill > Technical Support Consultant > OpenLink Software > http://www.openlinksw.com > Universal Database Connectivity Technology Providers
odbc-phpHOWTO.html
(text/plain, 40.4 KB)
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./odbc-phpHOWTO_files/filelist.xml">
<title>ODBC-PHP-APACHE HOWTO</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
@font-face
{font-family:"Arial Unicode MS";
panose-1:2 11 6 4 2 2 2 2 2 4;
mso-font-charset:128;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1 -369098753 63 0 4129023 0;}
@font-face
{font-family:"\@Arial Unicode MS";
mso-font-charset:128;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1 -369098753 63 0 4129023 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
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:blue;
text-decoration:underline;
text-underline:single;}
p
{margin-right:0in;
mso-margin-top-alt:auto;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
pre
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
font-size:10.0pt;
font-family:"Arial Unicode MS";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:59401281;
mso-list-type:hybrid;
mso-list-template-ids:-1286712032 879146426 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:1.0in;
mso-level-number-position:left;
margin-left:1.0in;
text-indent:-.25in;}
@list l1
{mso-list-id:454755549;
mso-list-type:hybrid;
mso-list-template-ids:-1978205632 771229224 -1562470178 83805654 1019275974 996705184 -218486880 2056817296 519589894 1355558320;}
@list l2
{mso-list-id:589971505;
mso-list-type:hybrid;
mso-list-template-ids:-1304531464 879146426 803222914 67698689 -955630032 815065836 -71563512 519598870 -1646869284 -550221728;}
@list l2:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level3
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l3
{mso-list-id:657152701;
mso-list-type:hybrid;
mso-list-template-ids:-1925398152 879146426 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l4
{mso-list-id:1253472207;
mso-list-type:hybrid;
mso-list-template-ids:934040370 879146426 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l5
{mso-list-id:1559976096;
mso-list-type:hybrid;
mso-list-template-ids:1776835266 879146426 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l5:level1
{mso-level-tab-stop:.25in;
mso-level-number-position:left;
margin-left:.25in;
text-indent:-.25in;}
@list l6
{mso-list-id:1778481168;
mso-list-type:hybrid;
mso-list-template-ids:-2109704328 879146426 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l6:level1
{mso-level-tab-stop:1.75in;
mso-level-number-position:left;
margin-left:1.75in;
text-indent:-.25in;}
@list l7
{mso-list-id:2070227880;
mso-list-type:hybrid;
mso-list-template-ids:613868628 251555960 198595258 360875310 -1507811306 -480213152 -83066994 -455863142 -729664516 -1477820354;}
@list l7:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue style='tab-interval:.5in'>
<div class=Section1>
<p><b><span style='font-family:Verdana'>ODBC-PHP HOWTO<span style='mso-tab-count:
4'> </span></span></b><span style='font-family:
Verdana'><o:p></o:p></span></p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Disclaimer<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Overview<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>iODBC<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Openlink ODBC<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>PHP / Apache Quick Install<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Sample connection<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l1 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Additional Sources of Information<o:p></o:p></span></li>
</ol>
<p><span style='font-size:10.0pt;font-family:Verdana'>Last updated May 15, 2000<o:p></o:p></span></p>
<ol start=1 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo2;tab-stops:list .5in'><b><span style='font-family:
Verdana'>Disclaimer</span></b><span style='font-family:Verdana'><o:p></o:p></span></li>
</ol>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>The
following is a HOWTO document for installing PHP libraries with Openlink ODBC
or iODBC as an Apache module on Linux/Unix systems. Feel free to criticize,
suggest modifications, or ask further questions. It is currently maintained by
Andrew Hill of Openlink Software. </span><span style='font-family:Verdana'><a
href="mailto:[email protected]"><span style='font-size:10.0pt'>[email protected]</span></a></span><span
style='font-size:10.0pt;font-family:Verdana'>.<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Prerequisites
include basic Unix familiarity, such as creating directories and users, using
an editor, etc.<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>This
HOWTO is intended to assist in connecting php/apache to back end databases via
ODBC in a development environment and should not take the place of thorough
testing before deployment on a production system. <o:p></o:p></span></p>
<ol style='margin-top:0in' start=2 type=1>
<li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b><span
style='font-family:Verdana'>Overview</span></b><span style='font-family:
Verdana'><o:p></o:p></span></li>
</ol>
<p class=MsoNormal style='margin-left:.25in;text-indent:.25in'><span
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in;mso-layout-grid-align:none;
text-autospace:none'><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
font-family:Verdana'>ODBC (Open Database Connectivity) is an operating system
and database independent communication API that allows a client application
(productivity tool, other database, web page, custom application, etc.) to communicate
via standard-based function calls to a back end database without relying on
that vendors proprietary communication protocols.<span style="mso-spacerun:
yes"> </span></span><span style='font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:Verdana;mso-bidi-font-family:"Courier New"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>ODBC connections involve an
application, driver manager, driver, and database.<span style="mso-spacerun:
yes"> </span>The driver manager under Microsoft Windows platforms is the ODBC
Control Panel.<span style="mso-spacerun: yes"> </span>The driver manager registers
a set of ODBC driver connection parameters called a Data Source Name
(DSN).<span style="mso-spacerun: yes"> </span>An application looks to the driver
manager for a DSN, and then passes the connection parameters specified in the
DSN to the appropriate driver, which makes the connection.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>A driver manager also makes ODBC
API call translations between different versions of the ODBC specification
where necessary.<span style="mso-spacerun: yes"> </span>Thus, its possible to
use a driver that is ODBC 2.5 compatible and make ODBC 3 calls against it, as
long as the driver manager is ODBC 3 compliant, and can make the necessary
translations.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>Under non-Windows platforms,
this driver manager will be supplied by third parties or sometimes bypassed
altogether.<span style="mso-spacerun: yes"> </span>Openlink Software maintains
an open-source driver manager and SDK called iODBC, which is available at <a
href="http://www.iodbc.org/">www.iodbc.org</a>.<span style="mso-spacerun:
yes"> </span>As you will note above, the driver manager is not a driver, and
does not enable connectivity by itself.<span style="mso-spacerun: yes">
</span>Compiling PHP with iODBC will make your php scripts ODBC-aware and
will allow you to use any ODBC driver with them, but does not provide you with
a driver directly.<span style="mso-spacerun: yes"> </span>The SDK is also
useful when building ODBC-compliant applications.<span style="mso-spacerun:
yes"> </span><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.75in;text-indent:.25in'><span
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>Openlink uses a similar iODBC
library in its commercial drivers, but one that is optimized for our drivers
and may be out-of-synch with the iODBC distribution version.<span
style="mso-spacerun: yes"> </span><span style="mso-spacerun: yes"> </span>This
means that you should choose to compile PHP with either Openlink, or iODBC, but
you do not need to do both.<span style="mso-spacerun: yes"> </span><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>Openlink has a 2-tier driver architecture
under linux/unix platforms.<span style="mso-spacerun: yes"> </span>This includes
a driver and driver manager on the client side, and a request broker and
database agent on the server side.<span style="mso-spacerun: yes"> </span>The
request broker listens for connection calls and initiates a connection between
the database agent and the database.<span style="mso-spacerun: yes">
</span>Openlinks database agent speaks directly to the CLI (Call Level
Interface) of the database, bypassing the vendor specific communication layer,
avoiding the addition of <span style="mso-spacerun: yes"> </span>an additional
communication layer.<span style="mso-spacerun: yes"> </span>This combined with
a thorough and efficient implementation of the ODBC specification, produces
very fast drivers with robust ODBC support.<span style="mso-spacerun: yes">
</span>Often SQL syntax that is not explicitly supported by database vendors is
enforced onto the database by Openlinks drivers.<span style="mso-spacerun:
yes"> </span>Full ANSI SQL92 support is enabled, allowing such things as
natural joins, is bi-directional scrollable cursor support, etc.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.75in;text-indent:.25in'><span
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.75in;text-indent:.25in'><span
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>N.B.<span style="mso-spacerun:
yes"> </span>Under linux/unix platforms, the driver manager and associated
library files are located by setting environment variables.<span
style="mso-spacerun: yes"> </span>These must be set before compiling apache
and php with ODBC support</span><span style='font-family:Verdana'>.<span
style="mso-spacerun: yes"> </span><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.25in;text-indent:.25in'><span
style='font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.25in;text-indent:.25in'><span
style='font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<ol style='margin-top:0in' start=3 type=1>
<li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b><span
style='font-family:Verdana'>iODBC </span></b><span style='font-family:
Verdana'><o:p></o:p></span></li>
</ol>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Download
the Openlink-maintained iODBC source code or RPM package from </span><span
style='font-family:Verdana'><a href="http://www.iodbc.org/"><span
style='font-size:10.0pt'>http://www.iodbc.org</span></a></span><span
style='font-size:10.0pt;font-family:Verdana'>. Compile source or install via
RPM in your system:<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>To
compile: (also refer to the README and INSTALL file to review changes)<o:p></o:p></span></p>
<ol start=3 type=1>
<ol start=1 type=a>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>download latest source code.
At the time of this writing, it is version 2.50.3 with a beta of 3.0.2
(ODBC 3.0) available.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>gunzip libiodbc-2.50.3<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>tar xvf libiodbc-2.50.3<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>cd libiodbc-2.50.3<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make check<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make install<o:p></o:p></span></li>
</ol>
</ol>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>To
install via RPM<o:p></o:p></span></p>
<ol start=3 type=1>
<ol start=8 type=a>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>determine your libc version.
The command: ls -l /lib/libc* should give you libc.so.5 (which is libc5)
or libc.so.6 (which is glibc2). RPM can also be queried for this
information, via: rpm -qa | grep libc<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>download the correct
libiodbc RPM for your libc version.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>rpm ivh
libiodbc-2.50.3-i386-glibc2.rpm (replace with the version you downloaded)
You may also use the prefix=/path/to/directory to relocate the
components as you wish.<o:p></o:p></span></li>
</ol>
</ol>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Repeat
the above instructions for the SDK and install script available at the same
location. The odbcsdk will contain an /odbcsdk/doc/odbc.doc file that includes
instructions for setting up odbc data sources. After setting up the SDK, you
can test ODBC using the odbctest binary in the /odbcsdk/examples/ directory
(see odbctest comments in the next section).<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
<ol start=4 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo2;tab-stops:list .5in'><b><span style='font-family:
Verdana'>Openlink ODBC</span></b><span style='font-family:Verdana'><o:p></o:p></span></li>
</ol>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Openlink
Multi-tier drivers involve installation on both the client and server sides of
your architecture. Proceed to </span><span style='font-family:Verdana'><a
href="http://www.openlinksw.com/"><span style='font-size:10.0pt'>http://www.openlinksw.com</span></a></span><span
style='font-size:10.0pt;font-family:Verdana'> and follow the "Product
Availability and Download" link. Select Multi-Tier drivers, and answer the
questions about server/client/database versions. For testing purposes this
HOWTO will assume the unix/linux machine is both your client and server.<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>The
Openlink odbcsdk contains many tools and utilities, as well as source code, and
is available at the same location.<o:p></o:p></span></p>
<ol start=4 type=1>
<ol start=1 type=a>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>mkdir /usr/local/openlink. <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>create an openlink user on
your system, with home directory /usr/local/openlink.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>download the drivers, the
request broker, database agent, and installation script to the directory.
<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>repeat the product selection
process for the odbcsdk, downloading the .taz file into the same
directory.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>run the install script:
./install.sh or sh install.sh, and follow the prompts. It is safe to take
the defaults, but be aware of what they are (e.g. admin/admin is default
for login/pass in the web-based Admin Assistant).<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>at this point, you should
have a fully installed, if not configured version of Openlink.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Examine your
/usr/local/openlink directory for a .profile or .bash-profile. Also
examine the contents of openlink.sh, and verify that the paths listed
match your installation. Cat the contents of the edited openlink.sh into
your .profile or .bash-profile. (create one if one doesnt exist). The
openlink.sh file contains environment variable settings. The .profile
will be run automatically when you login as openlink, and set the
appropriate variables. For now, run it manually:# . ./.profile. If you
have a distribution that has another default profile, such as Red Hats
.bash_profile, edit this file and add the line: . ./.profile to ensure
its picked up when you login.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Bring up the Openlink
request broker oplrqb +loglevel 7 <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Follow the Openlink
documentation for creating Data Source Names (DSNs) in the odbc.ini
file, and for configuring the database agent against your installed
database. <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Run the odbctest application
in the /openlink/samples/ODBC/ directory:# ./odbctest<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Type a "?" to make
sure your DSN appears, and enter DSN=dsnname at the prompt.<span
style="mso-spacerun: yes"> </span>Note that just putting in the DSN at
the prompt without a DSN= string will not work, as this prompt takes many
other parameters and needs a qualifying string before each one.<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Congratulations, you have a
working Multi-Tier ODBC connection.<o:p></o:p></span></li>
</ol>
</ol>
<p class=MsoNormal style='margin-left:.5in'><span style='font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo2;
tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
font-family:Verdana'>5.<span style='font:7.0pt "Times New Roman"'>
</span></span><![endif]><b><span style='font-family:Verdana'>PHP/Apache Quick
Install Instructions</span></b><span style='font-size:10.0pt;font-family:Verdana'>
(copied from the PHP installation section of the manual)<span
style="mso-spacerun: yes"> </span><o:p></o:p></span></p>
<p style='margin-left:.25in;text-indent:.25in'><span style='font-size:10.0pt;
font-family:Verdana'>Please choose to use either with-openlink or with-iodbc.<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Download
most recent source of apache from </span><span style='font-family:Verdana'><a
href="http://www.apache.org/dist/">http://www.apache.org/dist/</a><o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Download
the most recent version of PHP from </span><span style='font-family:Verdana'><a
href="http://www.php.net/"><span style='font-size:10.0pt'>www.php.net</span></a></span><span
style='font-size:10.0pt;font-family:Verdana'>.<o:p></o:p></span></p>
<p style='margin-left:.5in'><span style='font-size:10.0pt;font-family:Verdana'>Check
an output of your env command for the values of LD_LIBRARY_PATH.<span
style="mso-spacerun: yes"> </span>If not applied, do so, either by running
your profile (section 4g above) or by manually setting it:<span
style="mso-spacerun: yes"> </span>export
LD_LIBRARY_PATH=/path/to/iodbc/libraries/directory<o:p></o:p></span></p>
<ol start=5 type=1>
<ol start=1 type=a>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>gunzip apache_1.3.x.tar.gz <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>tar xvf apache_1.3.x.tar <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>gunzip php-3.0.x.tar.gz <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>tar xvf php-3.0.x.tar <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>cd apache_1.3.x <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>./configure --prefix=/www <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>cd ../php-3.0.x <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>./configure
--with-openlink=/path/to/openlink/ --with-iodbc=/path/to/iodbc/
--with-apache=../apache_1.3.x --enable-track-vars <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make install <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>cd ../apache_1.3.x <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>./configure --prefix=/www
--activate-module=src/modules/php3/libphp3.a <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>make install<o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>cd ../php-3.0.x <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>cp php3.ini-dist
/usr/local/lib/php3.ini. You can edit /usr/local/lib/php3.ini file to set
PHP options. If you prefer this file in another location, use --with-config-file-path=/path
in step h. <o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;font-family:Verdana'>Edit your httpd.conf or
srm.conf file and add (or uncomment): AddType application/x-httpd-php3
.php3 (You can choose any extension you wish here, .php3 is simply the
one we suggest.) </span><span style='font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:Verdana'><o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><span
style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>Use
your normal procedure for starting the Apache server. (You must stop and
restart the server, not just cause the server to reload by using a HUP or
USR1 signal.) </span><b><span style='font-family:Verdana'><o:p></o:p></span></b></li>
</ol>
</ol>
<pre><span style='font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></pre>
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo2;
tab-stops:list .5in'><![if !supportLists]><b><span style='font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:Verdana'>6.<span style='font:7.0pt "Times New Roman"'>
</span></span></b><![endif]><b><span style='font-family:Verdana'>Sample
Connection</span></b><b><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
font-family:Verdana'><o:p></o:p></span></b></p>
<p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>This
code can be saved at test.php3 in your /www/htdocs/ and you can examine it via
a browser pointing to http://domain_name/test.php3.<o:p></o:p></span></p>
<p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>Notice
the putenvs.<span style="mso-spacerun: yes"> </span>These variables include ones
necessary for an Openlink driver connection.<span style="mso-spacerun: yes">
</span>Third-party drivers with iODBC may require different environment variables.<span
style="mso-spacerun: yes"> </span>I usually put all the necessary variables in
an putenv.inc file, and require it at the beginning of each script that wants
ODBC connectivity.<span style="mso-spacerun: yes"> </span>Not a huge deal for
a small site with 3 putenvs on each page, but in practice you could have many
pages with many environment variables on each one.<span style="mso-spacerun:
yes"> </span>Its cleaner to only be able to make mistakes in one place.<span
style="mso-spacerun: yes"> </span>This also allows you to <span
style="mso-spacerun: yes"> </span>apply different sets of envs to different scripts,
interchanging values with great flexibility.<o:p></o:p></span></p>
<pre><span style='font-family:Verdana'><?<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib");<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>putenv("ODBCINSTINI=/usr/local/openlink/odbcinst.ini");<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>putenv("ODBCINI=/usr/local/openlink/odbc.ini");<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>$dsn="DSN=OracleLocal"; // this is a valid DSN set up in the above odbc.ini file, tested in odbctest<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>$user="scott"; //default user for the demo Oracle database<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>$password="tiger"; //default password for demo Oracle database<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>$sql="SELECT * FROM EMP"; <span style="mso-spacerun: yes"> </span><o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>// directly execute mode <o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>if ($conn_id=odbc_connect("$dsn","","")){<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'> <span style="mso-spacerun: yes"> </span>echo "connected to DSN: $dsn";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>if($result=odbc_do($conn_id, $sql)) {<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>echo "executing '$sql'";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'> <span style="mso-spacerun: yes"> </span>echo "Results: ";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>odbc_result_all($result);<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>echo "freeing result";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>odbc_free_result($result);<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>}else{<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span><span style="mso-spacerun: yes"> </span>echo "can not execute '$sql' ";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>}<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>echo "closing connection $conn_id";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>odbc_close($conn_id);<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>}else{<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><span style="mso-spacerun: yes"> </span>echo "can not connect to DSN: $dsn ";<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>}<o:p></o:p></span></pre><pre><span
style='font-family:Verdana'>?><o:p></o:p></span></pre><pre><span
style='font-family:Verdana'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></pre>
<ol start=7 type=1>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l2 level1 lfo2;tab-stops:list .5in'><b><span style='font-family:
Verdana'>Additional Sources of Info</span></b><span style='font-family:
Verdana'><o:p></o:p></span></li>
</ol>
<ul type=disc>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l7 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>The PHP manual, install instructions at </span><span
style='font-family:Verdana'><a
href="http://www.php.net/manual/install-unix.php3"><span style='font-size:
10.0pt'>http://www.php.net/manual/install-unix.php3</span></a><o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l7 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>The iODBC forum, at </span><span style='font-family:
Verdana'><a href="http://www.iodbc.org/"><span style='font-size:10.0pt'>www.iodbc.org</span></a><o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l7 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>The PHP mailing lists and archives, at </span><span
style='font-family:Verdana'><a href="http://www.php.net/support.php3"><span
style='font-size:10.0pt'>http://www.php.net/support.php3</span></a><o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l7 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Openlink Software Online Support, at </span><span
style='font-family:Verdana'><a
href="http://www.openlinksw.com/support/suppindx.htm"><span
style='font-size:10.0pt'>http://www.openlinksw.com/support/suppindx.htm</span></a><o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l7 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Openlink Software Discussion Forums, at </span><span
style='font-family:Verdana'><a
href="http://www.openlinksw.com/support/teclinks.htm"><span
style='font-size:10.0pt'>http://www.openlinksw.com/support/teclinks.htm</span></a><o:p></o:p></span></li>
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
mso-list:l7 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
font-family:Verdana'>Openlinks ODBC Whitepapers, at </span><span
style='font-family:Verdana'><a
href="http://www.openlinksw.com/info/docs/odbcwhp/tableof.htm"><span
style='font-size:10.0pt'>http://www.openlinksw.com/info/docs/odbcwhp/tableof.htm</span></a><o:p></o:p></span></li>
</ul>
<p><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
<p><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
</div>
</body>
</html>