I am new to the world of modperl.
Any help would be nice.
I have some perl code that runs fine from the command line but not
with modperl.
#!/usr/local/bin/perl
use strict;
use DBI;
print "Content-type: text/plain\n\n";
print "check1";
# Connect to the database.
my $dbh =
DBI->connect("DBI:mysql:database=answerguy;host=elmo.elmo.theanswerguy.co.nz",
"robsonde", "ur4xgod",
{'RaiseError' => 1});
# Now retrieve data from the table.
my $sth = $dbh->prepare("SELECT * FROM Question Where QID=2");
$sth->execute();
while (my $ref = $sth->fetchrow_hashref()) {
print "Found a row: id = $ref->{'Qtext'}\n";
}
$sth->finish();
# Disconnect from the database.
$dbh->disconnect();
print "check2";
from the command line......
# ./test
Content-type: text/plain
check1Found a row: id = How did John Lennon die?
check2#
from the browser i get..........
check1
the browser is not waiting on data, it thinks it has the whole page.
in my httpd.conf I have...
Alias /perl/ /var/www/perl/
PerlModule Apache::PerlRun
PerlModule DBI
PerlModule DBD::mysql
<Location /perl/>
SetHandler perl-script
PerlHandler Apache::PerlRun
Options +ExecCGI
PerlSendHeader On
allow from all
</Location>
I get no errors in the error_log for apache.
stats for my system.......
OpenBSD elmo.co.nz 3.8 GENERIC#138 i386
perl v5.8.6
Apache/1.3.29 (Unix) mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.7g
mysql Ver 12.22 Distrib 4.0.24
any help would be nice.