I have what must be a very stupid problem...

I cannot get Apache httpd to start when I use DBI in the startup file.

Here are two examples of my startup file.  The first one works (i.e.,
httpd runs).  The second one fails (i.e., httpd won't run.)

1. Startup.pl

#!/usr/bin/perl
# use DBI;
1;

2. Startup.pl

#!/usr/bin/perl
use DBI;
1;

I can run 2. in the perl debugger and it works just fine.

In fact I can run 3. below (in the debugger *and* by running httpd) and
it prints a legitimate count in /tmp/count, but no httpd is running when
it finishes.  So the "use DBI" is working, but the httpd deamon dies
anyway, but only when "use DBI" is present.

3. Startup.pl

#!/usr/bin/perl
use DBI;

open(F, '> /tmp/count)

$Dbh = DBI->connect('dbi:Sybase:server=DECODER;database=Decoder', 'sa', 'myPw');
my $sth = $Dbh->prepare('set rowcount 10 select * from DecoderCity');
$sth->execute;
while (my $r = $sth->fetch) {
    push(@Records, $r);
}
$Dbh->disconnect;
$Dbh = undef;
print F "$#Records\n";
close(F);

I don't know where to begin to debug this.  Any suggestions?

Thanks,
Dick Kreutzer
AmeriCom Inc.

P.S. I know about Apache::DBI but it is not appropriate for my
     application.  Also, I am running Redhad Linux 6.2 (kernel
     2.2.12-20smp) and Apache/1.3.9 (Unix)  (Red Hat/Linux)

Reply via email to