Stas,
First, there was no mod_perl 1.2x installed on this machine.  I didn't think
I would need it, but I'm guessing.

This was as you say.  The <Location /perl> didn't aggree with the registry
loaded in startup.  That fixed that problem but now it complains about
CGI.pm as follows:

[Tue Apr 23 10:10:00 2002] [error] 2676: ModPerl::Registry: `Can't call
method "args" on an undefined value at c:/perl/5.6.1/lib/CGI.pm line 433.

As you suggested, the use Apache::compat; is in startup.  It had no effect.

Here is location in http.conf
LoadModule perl_module modules/mod_perl.so
Alias /perl e:/Apache2/cgi-perl
PerlRequire e:\apache2\conf\startup.cgi

# Access.conf
<Location /perl>
  # Below for .js files
  AllowOverride FileInfo
  # Below changed from Set to Add to accomodate .js files
  # Vaguely recall some problem on newsgroups but?????
  # don't use this one SetHandler perl-script
  AddHandler perl-script .cgi
  #PerlHandler Apache::Registry
  PerlHandler ModPerl::Registry
  PerlResponseHandler ModPerl::Registry
  Options ExecCGI
  allow from 206.128.139
  PerlSendHeader On
</Location>

==> Here is startup.cgi
#! /perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w

use strict;
#use Apache ();
use Apache2 ();
use Apache::compat;
use ModPerl::Registry;
use DBI();
use CGI qw(-compile :cgi);
use Carp();

use DBI();
use CGI qw(-compile :cgi);

1;
__END__

===> Here's the test program:
#! c:/perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
use Apache2 ();
use Apache::compat;
use ModPerl::Registry;    #  use Apache::Registry;

use CGI qw/:standard :html3/;
use CGI::Carp qw(fatalsToBrowser);
use DBI(); # use Apache::DBI();
$cgiOBJ = new CGI;

$dataSource             = "dbi:Oracle:dis.world"; # put your DSN here
$dataSource             = "dbi:Oracle:rciora"; # put your DSN here
$userName               = 'terminals'; # you know what goes here
$password               = 'xxxx'; # and here
$dbh = DBI->connect($dataSource, $userName, $password)
    or die $DBI::errstr;

print $cgiOBJ->header(-expires=>'-1d'),
      $cgiOBJ->start_html(-TITLE=>'oracle test.pl',
                          -BGCOLOR=>'#FFFFFF');

print "start here<hr>";
$sql = "SELECT * FROM terminals.assets where substr(asset_part_no,1,1) =
'B'";
$sth = $dbh->prepare($sql) || die $dbh->errstr;
$rc = $sth->execute || die  $sth->errstr;
while (($firstField, $anotherField) = $sth->fetchrow_array){
        print "$firstField: $anotherField<br>\n";
}
warn $DBI::errstr if $DBI::err;
$sth->finish;

$dbh->disconnect;

print "<hr>end here";

print $cgiOBJ->end_html;

Thanks for any input.

Chuck




----- Original Message -----
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chuck Goehring" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 7:26 PM
Subject: Re: startup for Apache 2.0/mod_perl 1.99


> Chuck Goehring wrote:
> > To all,
> >
> >
> >
> > Having trouble configuring Apache 2.0 with mod_perl.  Don't know if I
> > need compat or not.
> >
> >
> >
> > My Apache 1.x/mod_perl 1.24 startup starts like this:
> >
> >
> >
> > use strict;
> > use Apache ();
> > use Apache::Registry;
> > use Apache::DBI();
> > use CGI qw(-compile :cgi);
> > use Carp();
> >
> >
> >
> > That didn't fly on Apache 2.0.35/mod_perl 1.99 (snapshot).  Trying to
> > get something equivalent working.
>
> If you want to use the old registry, the above missing:
>
> use Apache2 ();
> use Apache::compat;
>
> > Below doesn't work with or without
> > Apache::compat.
> >
> >
> >
> > use strict;
> > use Apache2 ();
> > use Apache::compat;
> > use ModPerl::Registry;    #  use Apache::Registry;
> >
> > #use Apache2::DBI();      # use Apache::DBI();
> > use DBI();
> > use CGI qw(-compile :cgi);
>
> looks good to me. You don't show your <Location> config. Does it include
>
>    SetHandler perl-script
>    PerlResponseHandler ModPerl::Registry
>
> ??
>
> > Apache error log id like so (last line):
> >
> > [Mon Apr 22 18:00:58 2002] [error] failed to resolve handler
> > `Apache::Registry'
>
> Apache::Registry? Above you said you are using ModPerl::Registry. Check
> your config. I suggest to grep for Apache::Registry.
>
> Apache::DBI (for 2.0 wasn't ported yet, and available for those seeking
> interesting challenges)
>
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to