perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Atsushi Fujita" <atsu...@ynot.co.jp>
Subject Re: mod_perl2 & DBD::Oracle problem
Date Fri, 02 Aug 2002 05:49:54 GMT
Hi Stas,

> Do you suggest that %ENV is getting lost along the way? Or can it be
> some other problem? I don't have Oracle to test with. Or can you think
> of some other way to reproduce the problem without depending on Oracle
> being installed?

I think this reason is my configuration or DBI/DBD module problem.
I checked some DBI/DBD module program(DBI.pm/Oracle.pm).
In these program, %ENV and other variable was correct.
But I didn't check more deep C program, I'll ask them to other place.

> 1.
> instead of using ModPerl::Registry, use Apache::Registry. Of course
> configure <Location> to use Apache::Registry.
>
> use Apache::compat;
> use Apache::Registry; # hopefull you have mod_perl 1.0 installed
>
> any change when you use the Apache::Registry from 1.0? Currently the
> only difference (mainly) is that ModPerl::Registry doesn't chdir() into
> the script's dir. (which eventually will change)

I tried to use Apache::Registry, but it still showed same error in error_log
as following.

----[error_log]----
DBI->connect(ynt0) failed: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check
ORACLE_HOME and NLS settings etc. at
/yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin/test1.cgi line 30
[Wed Jul 31 19:00:24 2002] [error] Cannot connect: (UNKNOWN OCI STATUS 1804)
OCI Initialize. Check ORACLE_HOME and NLS settings etc. at
/yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin/test1.cgi line 30.
--------


My machine is as following.

  - perl5.6.1(/yopt/perl5.6.1normal)
  - DBI-1.30
  - DBD-Oracle-1.12
  - mod_perl1.99_04(DSO build)
  - apache2.0.39(/yopt/httpd-2.0.39_prefork_perl5.6.1normal)

  - perl5.005_3(/yopt/perl5.0)
  - mod_perl1.26(static build, for installing Apache::Registry)
  - apache1.3.26(/yopt/apache_1.3.26)


----[httpd.conf]----
LoadModule perl_module modules/mod_perl.so
.......
<IfModule mod_perl.c>
  PerlRequire "/yopt/httpd-2.0.39_prefork_perl5.6.1normal/conf/startup.pl"
  PerlModule ModPerl::Registry
  <Location /cgi-bin>
    SetHandler perl-script
    PerlResponseHandler Apache::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
  </Location>
</IfModule>
--------


----[startup.pl]----
#!/yopt/perl5.6.1normal/bin/perl

use Apache2 ();
use Apache::compat ();
use lib qw(/yopt/perl5.0/lib/site_perl/5.005/i686-linux);

use Apache::Registry ();

1;
--------



Thank you very much,


Atsushi.



----- Original Message -----
From: "Stas Bekman" <stas@stason.org>
To: "Atsushi Fujita" <atsushi@ynot.co.jp>
Cc: <modperl@perl.apache.org>
Sent: Wednesday, July 31, 2002 11:18 AM
Subject: Re: mod_perl2 & DBD::Oracle problem


> Atsushi Fujita wrote:
> > Hi all,
> >
> > I am trying to use DBD::Oracle1.12 on mod_perl2.
> > But it doesn't work fine.
> > It shows error as following in error_log at $dbh = DBI->connect.
> >
> > ----[error_log]----
> > DBI->connect(ynt0) failed: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check
> > ORACLE_HOME and NLS settings etc. at
> > /yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin/test1.cgi line 42
> > [Mon Jul 29 20:15:37 2002] [error] 25703: ModPerl::Registry: `Cannot
connect:
> > (UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and
> >  NLS settings etc.at
> > /yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin/test1.cgi line 42.
> > --------
> >
> >
> > ----[test1.cgi]----
> > use DBI;
> >
> > my $dsn      = 'dbi:Oracle:';
> > my $user     = 'username/password';
> > my $password = '';
> >
> > $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;
> > ...
> > --------
> >
> > At first, I suspect that the reason is %ENV in this script.
> > But I set surely, and this output as following.
> >
> > ----[Broser output HTML]----
> > ORACLE_HOME=/u01/app/oracle/product/9.0.1
> > ORACLE_SID=ynt0
> > NLS_LANG=japanese_japan.ja16euc
> > DSN=dbi:Oracle:ynt0
> >
> > Internal Server Error
> > The server encountered an internal error or misconfiguration and was
unable to
> > complete your request.
> > ....
> > --------
> >
> > And if I turned off the mod_perl, it works fine on normal CGI-script.
> > This error occurred only mod_perl.
> > (I tested mod_perl1.26 & apache 1.3.26, it worked fine...)
> >
> > My machine is as following.
> >   - perl5.6.1(non thread)
> >   - DBI-1.30
> >   - DBD-Oracle-1.12
> >   - mod_perl1.99_04(DSO build)
> >   - apache2.0.39(prefork)
> >
> >
> > ----[httpd.conf]----(is this wrong??)
> > LoadModule perl_module modules/mod_perl.so
> > .......
> > <IfModule mod_perl.c>
> >     PerlModule ModPerl::Registry
> >     <Location /cgi-bin>
> >         SetHandler perl-script
> >         PerlResponseHandler ModPerl::Registry
> >         PerlOptions +ParseHeaders
> >         Options +ExecCGI
> >     </Location>
> > </IfModule>
> > --------
>
> Do you suggest that %ENV is getting lost along the way? Or can it be
> some other problem? I don't have Oracle to test with. Or can you think
> of some other way to reproduce the problem without depending on Oracle
> being installed?
>
> Can you please test with the following two approaches:
>
> 1.
>
> instead of using ModPerl::Registry, use Apache::Registry. Of course
> configure <Location> to use Apache::Registry.
>
> use Apache::compat;
> use Apache::Registry; # hopefull you have mod_perl 1.0 installed
>
> any change when you use the Apache::Registry from 1.0? Currently the
> only difference (mainly) is that ModPerl::Registry doesn't chdir() into
> the script's dir. (which eventually will change)
>
> 2. use a mod_perl handler
>
>
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>
>




Mime
View raw message