Atsushi Fujita wrote:
> Hi Stas,
>
> I checked using by 'SetHandler modperl', but apache responded no data without
> error.
> Apache log said HTTP response code was 200, but size was 0.
>
> 192.168.1.xxx - - [16/Aug/2002:22:01:51 +0900] "GET /cgi-bin/test1.cgi
> HTTP/1.1" 200 0
>
> What is wrong? I still counldn't understand clearly.
because under 'SetHandler modperl' the script must be written
differently. I guess the easiest is to try the other way around. Take
the mod_perl handler that worked, and change it to be 'SetHandler
perl-script', does it still work?
> Thank you.
>
> Atsushi
>
> ----[/conf/httpd.conf]----
> <IfModule mod_perl.c>
> PerlRequire "/yopt/httpd-2.0.39_prefork_perl5.6.1normal/conf/startup.pl"
>
> PerlModule ModPerl::Registry
> <Location /cgi-bin>
> SetHandler modperl
> PerlResponseHandler ModPerl::Registry
> PerlOptions +ParseHeaders
> Options +ExecCGI
> </Location>
> </IfModule>
> --------
>
>
> ----[/conf/startup.pl]----
> use Apache2 ();
>
> use lib qw(/yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin);
>
> # enable if the mod_perl 1.0 compatibility is needed
> # use Apache::compat ();
>
> use ModPerl::Util (); #for CORE::GLOBAL::exit
>
> use Apache::RequestRec ();
> use Apache::RequestIO ();
> use Apache::RequestUtil ();
>
> use Apache::Server ();
> use Apache::ServerUtil ();
> use Apache::Connection ();
> use Apache::Log ();
>
> use APR::Table ();
>
> use ModPerl::Registry ();
>
> use Apache::Const -compile => ':common';
> use APR::Const -compile => ':common';
>
> 1;
> --------
>
>
> ----[/cgi-bin/test1.cgi]----
> #!/yopt/perl5.6.1normal/bin/perl
> use strict;
> use DBI;
>
> my $dsn = 'dbi:Oracle:';
> my $user = 'username/password';
> my $password = '';
>
> my $dbh;
> my $sth;
>
> my $sql = "select SEQUENCE_OWNER, SEQUENCE_NAME, LAST_NUMBER from
> ALL_SEQUENCES";
>
> my $rv;
> my @row;
>
> #################
>
> print "Content-type: text/html\n\n";
>
> $ENV{'ORACLE_HOME'} = '/u01/app/oracle/product/9.0.1';
> $ENV{'ORACLE_SID'} = 'ynt0';
> $ENV{'NLS_LANG'} = 'japanese_japan.ja16euc';
>
> print "ORACLE_HOME=$ENV{'ORACLE_HOME'}<br>\n";
> print "ORACLE_SID=$ENV{'ORACLE_SID'}<br>\n";
> print "NLS_LANG=$ENV{'NLS_LANG'}<br>\n";
> print "DSN=$dsn$ENV{'ORACLE_SID'}<br>\n";
>
> $dbh = DBI->connect("$dsn$ENV{'ORACLE_SID'}", $user, $password)
> or die "Cannot connect: ".$DBI::errstr;
>
> $sth = $dbh->prepare($sql)
> or die "Cannot prepare: ".$dbh->errstr();
>
> $rv = $sth->execute
> or die "Cannot execute: ".$sth->errstr();
>
> print "sth=$sth,rv=$rv\n";
>
> while(@row = $sth->fetchrow_array){
> print "@row\n";
> }
>
> $sth->finish();
> $dbh->disconnect();
>
> exit(0);
> --------
>
>
> ----- Original Message -----
> From: "Stas Bekman" <[EMAIL PROTECTED]>
> To: "Atsushi Fujita" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, August 16, 2002 6:12 PM
> Subject: Re: apache2, DBD/Oracle problem
>
>
>
>>Atsushi Fujita wrote:
>>
>>>Hi Stas,
>>>
>>>
>>>
>>>>Can you please try to convert the script into a mod_perl handler and
>>>>test again?
>>>
>>>
>>>OK, I just checked it.
>>>The result was everything fine using by mod_perl handler!
>>>There was no problem in my new code.
>>
>> >
>>
>>>...But I want to use ModPerl::Registry, because this is easy to migrate
>>
> from
>
>>>normal CGI script.
>>>Please investigate the reason.
>>
>>I still doubt it's a registry problem. Because you've used different
>>SetHandler's for the registry and the mod_perl handler.
>>
>>I bet that if you set:
>>
>> <Location /perl>
>> SetHandler modperl
>> ^^^^^^^
>> PerlResponseHandler ModPerl::Registry
>> PerlOptions +ParseHeaders
>> Options +ExecCGI
>> </Location>
>>
>>it'll all work.
>>
>>Read:
>>
>
> http://perl.apache.org/docs/2.0/user/config/config.html#mod_perl_2_0_Handlers
>
>>and that will explain the problem.
>>
>>Please let us know if this was indeed the cause.
>>
>>__________________________________________________________________
>>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
>>
>>
>
>
--
__________________________________________________________________
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