I was having connection trouble on Mandrake 9.2. PHP could connect only
intermittently.
Adding:
. /home/db2inst1/sqllib/db2profile
to /etc/rc.d/init.d/httpd and restarting the httpd fixed the problem. Thus, the
standard Mandrake 9.2 distribution worked after I made the changes mentioned in
my post to this group on 2004-02-13 and this change to the httpd script.
Rick
Helmut Tessarek wrote:[color=blue]
> Hi Robert,
>
> On Mon, 16 Feb 2004 21:54:00 -0500, Robert Stearns
> <rstearns1241@charter.net> wrote:
>[color=green]
>> I get the following output from a very simple page which tries to
>> connect to a db2 database hosted on my linux system, which is also
>> hosting my apache/php system. I have tried several permutations of the
>> connect string:
>> "animals"
>> "odbc://localhost/animals"
>> "dbc:/user@keyword/localhost/animals"[/color]
>
>
> $dbname = "animals";
> $dbuser = "userid";
> $dbpwd = "password";
>
> $conn = odbc_pconnect( $dbname, $dbuser, $dbpwd );
>
> This should do it. It seems that the environment is not set correctly.
> Have you added
> . /home/db2inst1/sqllib/db2profile
> to the apachectl file?
>
> You can find an article on how to set up Apache with SSL, PHP and DB2 on
> the following site
>
>
http://www.evermeet.cx/db2issues/sho...2:28:46.276772
>
> A pdf doc is available there aswell.
>
>[/color]