Re: Postgres' DBI(Pg) problem

From: Tommi Mäkitalo <t(dot)maekitalo(at)epgmbh(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres' DBI(Pg) problem
Date: 2001-11-22 07:18:13
Message-ID: 3BFCA6B5.10500@epgmbh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

did you set your LD_LIBRARY_PATH in your apache-config? You should put a
"SetEnv LD_LIBRARY_PATH (wherever your . is)/pgsql/lib). And reload or
restart apache of course.

Tommi

Nikos Kapsalis wrote:

> Hi !
>
>
>
> I have installed :
>
>
>
> PostgreSQL 7.0
>
> + DBI and DBD::Pg
>
> + the environment vars : LD_LIBRARY_PATH and PGLIB are set to my
> ./pgsql/lib directory
>
> + Apache 1.3.22 without "mod_perl" installed
>
>
>
> *When I write a program like :*
>
>
>
> /#!/bin/perl -w/
>
>
>
> /use DBI;
> my $dbh, $sth;/
>
> /$dbh = DBI->connect("dbi:Pg:dbname=researchdb") or die $DBI::errstr;
> $sth = $dbh->prepare("insert into course values('$v1', '$v2')") or die
> $DBI::errstr;/
>
> /.../
>
> /.../
>
> /.../
>
> *That runs perfect.*
>
>
>
>
>
> *When I am trying to write a CGI script like this which will run under
> apache : *
>
>
>
> /#!/bin/perl -w/
>
> /use strict;/
>
> /use CGI;/
>
> /use CGI::Carp qw(fatalsToBrowser);/
>
> /use DBI;/
>
> /my $dbh, $sth, $query;/
>
> /$query = new CGI;/
>
> /$dbh = DBI->connect("dbi:Pg:dbname=researchdb") or die $DBI::errstr;
> $sth = $dbh->prepare("insert into answers values('test1', 'test2');")
> or die $DBI::errstr;/
>
> /../
>
> /print $query->header( ..../
>
> /../
>
> /../
>
>
>
> *It gives me the following error in the browser.*
>
>
>
> /install_driver(Pg) failed: [Thu Nov 15 12:09:30 2001] *
> writeAnswers*: [Thu Nov 15 12:09:30 2001] *writeAnswers* : Can't load
> '/usr/lib/perl5/site_perl/i386-linux/auto/DBD/Pg/Pg.so' for module
> DBD::Pg: File not found at /usr/lib/perl5/i386-linux/DynaLoader.pm
> line 169. [Thu Nov 15 12:09:30 2001] *writeAnswers*: [Thu Nov 15
> 12:09:30 2001] *writeAnswers*: [Thu Nov 15 12:09:30 2001]
> *writeAnswers*: [Thu Nov 15 12:09:30 2001] *writeAnswers* : at (eval
> 11) line 3 Perhaps a required shared library or dll isn't installed
> where expected at /home/pcguest/sambaShare/cgi-bin/*MR.pm * line 12 /
>
>
>
> *-- (Just to know : "writeAswers" is a function which calls the "use
> DBI;" in the "MR.pm" file )*
>
> *-- Any idea how to solve that problem ?*
>
>
>
>
> ------------------------------------------------------------------------
> Get your FREE download of MSN Explorer at http://explorer.msn.com
> <http://go.msn.com/bql/hmtag_itl_EN.asp>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Denis Gasparin 2001-11-22 07:43:42 Re: Using Postgresql for RedHatLinux with VB
Previous Message Thirumoorthy Bhuvneswari 2001-11-22 04:40:55 Using Postgresql for RedHatLinux with VB