Re: Apache problem when using DBI

2004-02-24 Thread Rudy Lippan
On Tue, 24 Feb 2004, Kevin Moore wrote:

> [Tue Feb 24 18:11:31 2004] [error] [client 192.168.1.3] Can't locate 
> Apache/Constants.pm in @INC (@INC contains: 

I reckon you don't have Apache::Constants in @INC :)  
Apache::Constants was replaced by Apache::Const in apache 2.0

> use Apache;
> use Apache::DBI;
^^^ 
You would not either of those two unless you are running under
mod_perl, but from the looks of your script, I would have to surmise that
you are running under straight CGI.


And from the Apache::DBI docs:

MOD_PERL 2.0

Apache::DBI version 0.90_02 and later might work under mod_perl 2.0. See 
the Changes file for more information. Beware that it has only been tested 
very lightly.
==

So you probably do not want to be running Apache::DBI anyway.

HTH,

Rudy




Apache problem when using DBI

2004-02-24 Thread Kevin Moore
I have a perl script that runs flawlessly from command line but gived 
the ERROR 500 when attempting to run same script through Apache. O/S is 
red hat linux 9

Perl version
perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
Error from apache log file

[Tue Feb 24 18:11:31 2004] [error] [client 192.168.1.3] Premature end of 
script headers: dbcheck.pl
[Tue Feb 24 18:11:31 2004] [error] [client 192.168.1.3] Can't locate 
Apache/Constants.pm in @INC (@INC contains: 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.6.1 /usr/perl/mod_perl-1.27/Apache/blib/lib 
/usr/lib/perl5/5.8.0/CGI /usr/lib/perl5/5.8.0/i386-linux-thread-multi 
/usr/lib/perl5/5.8.0 
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at 
/usr/lib/perl5/site_perl/5.6.1/Apache.pm line 6.
[Tue Feb 24 18:11:31 2004] [error] [client 192.168.1.3] BEGIN 
failed--compilation aborted at /usr/lib/perl5/site_perl/5.6.1/Apache.pm 
line 6.
[Tue Feb 24 18:11:31 2004] [error] [client 192.168.1.3] Compilation 
failed in require at /home/httpd/cgi-bin/dbcheck.pl line 13.
[Tue Feb 24 18:11:31 2004] [error] [client 192.168.1.3] BEGIN 
failed--compilation aborted at /home/httpd/cgi-bin/dbcheck.pl line 13.

Top of script

#! /usr/bin/perl

$ENV{ORACLE_HOME} = '/home/oracle/product/9ias';
$ENV{TWO_TASK} = 'WEBAPP.WORLD';
print "Content-type: text/html", "\n\n";
print "", "\n";
print "";
print " Testing Team List", "\n";
print "", "\n";
print "";
use Apache;
use Apache::DBI;
use DBI;
use CGI::Carp qw(fatalsToBrowser);
use strict;
my $dbh =

Oracle database is 9.2.0.4.
Apache version is 2.0.40
DBI version is DBI-1.40
I've googled this to death, read notes everywhere, and quite frankly 
need help with where/how to fix this. I'm guessing I need to add 
something to the httpd.conf file to fix this. Would appreciate any help 
I can get. Thanks.

Kevin