Postgres' DBI(Pg) problem

From: "Nikos Kapsalis" <nckdip(at)hotmail(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Postgres' DBI(Pg) problem
Date: 2001-11-16 00:17:51
Message-ID: F39liLRCRoVDkxEbQGR0001b7ed@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Attachment Content-Type Size
unknown_filename text/html 2.7 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2001-11-16 00:53:22 Re: Database server crash ! URGENT !
Previous Message Sunit Bhatia 2001-11-15 23:55:32 Re: Database server crash ! URGENT !