Subject: | DBD-SQLite with mod_perl |
Date: | Thu, 16 Jul 2009 10:00:04 +0200 (CEST) |
To: | bug-DBD-SQLite [...] rt.cpan.org |
From: | igor.bujna [...] post.cz |
Good morning,
I have little problem with implementation DBD-SQLite and mod_perl. Everything is operated on the last updated version of CentOS-5.2 and version DBD-SQLite is 1.25.
When using the console, the program show all as it should be. But when using Apache and mod_perl than i have some problem.
Configuration for apache
Alias / test-cgi / tmp / test-cgi
<Directory / tmp / test-cgi <
AddHandler perl-script. Pl
SetHandler perl-script
# PerlResponseHandler ModPerl:: Registry
PerlResponseHandler ModPerl:: PerlRun
PerlOptions + ParseHeaders
Options + ExecCGI
</ Directory <
This is test script
#!/usr/bin/perl
use strict;
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=/tmp/sqlite.db","","",
{RaiseError => 1, PrintError => 1, AutoCommit => 1});
my $hash_ref = $dbh->selectall_hashref('SELECT * FROM pob ORDER BY city, c_pob;',"c_pob");
my %h_l = ();
while(my($k, $d) = each %$hash_ref) {
my $str = substr($d->{'city'},0,1);
if (defined($str)) {
my $s = uc($str);
if (exists($h_l{$s})) {
my $d = $h_l{$s};
push(@$d, $k);
} else {
$h_l{$s} = [$k];
}
print $d->{'city'} . "\n";
}
}
$dbh->disconnect();
And there is eror in log httpd
DBD::SQLite::db selectall_hashref failed: not an error at /tmp/test-cgi/test.pl line 11. [Wed Jul 15 23:14:08 2009] [error] DBD::SQLite::db selectall_hashref failed: not an error at /tmp/test-cgi/test.pl line 11.\n ModPerl::ROOT::ModPerl::PerlRun::tmp_test_cgi_test_2epl::handler('Apache2::RequestRec=SCALAR(0x802f4d84)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 204 eval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 204 ModPerl::RegistryCooker::run('ModPerl::PerlRun=HASH(0x8074ea00)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 170 ModPerl::RegistryCooker::default_handler('ModPerl::PerlRun=HASH(0x8074ea00)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/PerlRun.pm line 31 ModPerl::PerlRun::handler('ModPerl::PerlRun', 'Apache2::RequestRec=SCALAR(0x802f4d84)') called at -e line 0 eval {...} called at -e line 0 [Wed Jul 15 23:02:39 2009] [error] DBD::SQLite::db selectall_hashref failed: not an error at /tmp/test-cgi/test.pl line 33.\n at /tmp/test-cgi/test.pl line 33\n\tModPerl::ROOT::ModPerl::PerlRun::tmp_test_cgi_test_2epl::handler('Apache2::RequestRec=SCALAR(0x802f4d84)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 204\n\teval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 204\n\tModPerl::RegistryCooker::run('ModPerl::PerlRun=HASH(0x8074ea00)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 170\n\tModPerl::RegistryCooker::default_handler('ModPerl::PerlRun=HASH(0x8074ea00)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/PerlRun.pm line 31\n\tModPerl::PerlRun::handler('ModPerl::PerlRun', 'Apache2::RequestRec=SCALAR(0x802f4d84)') called at -e line 0\n\teval {...} called at -e line 0\n