EvanCarroll has asked for the wisdom of the Perl Monks concerning the following question:
I have this as my apache httpd.conf perl stanza:[Wed Oct 12 22:13:18 2005] [notice] Apache/1.3.33 (Debian GNU/Linux) m +od_ssl/2.8.24 OpenSSL/0.9.7g mod_perl/1.29 configured -- resuming nor mal operations [Wed Oct 12 22:13:18 2005] [notice] Accept mutex: sysvsem (Default: sy +svsem) [Wed Oct 12 22:13:18 2005] [error] Can't connect to data source Pg:dbn +ame='rodneyd', no database driver specified and DBI_DSN env var not s et at /usr/local/share/perl/5.8.7/Apache/DBI.pm line 146\n [Wed Oct 12 22:13:18 2005] [error] Can't connect to data source Pg:dbn +ame='rodneyd', no database driver specified and DBI_DSN env var not s et at /usr/local/share/perl/5.8.7/Apache/DBI.pm line 146\n [Wed Oct 12 22:13:18 2005] [error] Can't connect to data source Pg:dbn +ame='rodneyd', no database driver specified and DBI_DSN env var not s et at /usr/local/share/perl/5.8.7/Apache/DBI.pm line 146\n [Wed Oct 12 22:13:18 2005] [error] Can't connect to data source Pg:dbn +ame='rodneyd', no database driver specified and DBI_DSN env var not s +et at /usr/local/share/perl/5.8.7/Apache/DBI.pm line 146\n
db.pl:PerlModule Apache::DBI PerlModule Apache::Session::Postgres PerlModule Apache::Cookie PerlRequire /etc/apache-perl/db.pl
Any ideas why I'm getting this error? Or what to do about it, I have tried setting the env variable in apache and in $ENV{DBI_DSN} no joy.my $dsn = 'rodneyd'; my $usn = 'postgres'; Apache::DBI->connect_on_init(qq{dbi:Pg:dbname=$db}, $usn, '' ) || die +"bleh"; Apache::DBI->setPingTimeOut($dsn, 30 ); 1;
I assume that works, because the database ran fine with that exact string before I started to use Apache::DBI, and it pulls from the database fine.$dbh = DBI->connect("dbi:Pg:dbname=rodneyd",q/postgres/,"",{AutoCommit + =>0, RaiseError=>1, PrintError=>0}) || die "Could not Connec t to DB".$dbi::errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: No database driver specified and DBI_DSN env var not set
by jpeg (Chaplain) on Oct 13, 2005 at 04:17 UTC | |
by EvanCarroll (Chaplain) on Oct 13, 2005 at 04:35 UTC | |
|
Re: No database driver specified and DBI_DSN env var not set
by jbrugger (Parson) on Oct 13, 2005 at 04:23 UTC | |
by EvanCarroll (Chaplain) on Oct 13, 2005 at 04:29 UTC | |
|
Re: No database driver specified and DBI_DSN env var not set
by randyk (Parson) on Oct 13, 2005 at 04:55 UTC | |
|
Re: No database driver specified and DBI_DSN env var not set
by jonix (Friar) on Nov 23, 2005 at 14:40 UTC |