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.  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);
 
 
Apache error log id like so (last line): 
...
 
[Mon Apr 22 18:00:23 2002] [notice] Parent: Child process exited successfully.
[Mon Apr 22 18:00:38 2002] [notice] Parent: Created child process 2560
[Mon Apr 22 18:00:46 2002] [notice] Child 2560: Child process is running
[Mon Apr 22 18:00:46 2002] [notice] Child 2560: Acquired the start mutex.
[Mon Apr 22 18:00:46 2002] [notice] Child 2560: Starting 250 worker threads.
[Mon Apr 22 18:00:58 2002] [error] failed to resolve handler `Apache::Registry'
 
 
From perl -V:
  @INC:
    c:/perl/5.6.1/lib/MSWin32-x86-multi-thread
    c:/perl/5.6.1/lib
    c:/perl/site/5.6.1/lib/MSWin32-x86-multi-thread
    c:/perl/site/5.6.1/lib
    .
 
Test program:
 
#! c:/perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
use CGI qw/:standard :html3/;
use CGI::Carp qw(fatalsToBrowser);
use DBI(); # use Apache::DBI();
$cgiOBJ = new CGI;

$dataSource             = "dbi:Oracle:rciora"; # put your DSN here
$userName               = 'terminals';
$password               = 'xxx';
$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;
 
# disconnect from database
$dbh->disconnect;
 
print "<hr>end here";
 
print $cgiOBJ->end_html;
 
 
 

Reply via email to