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>
--------


Thanks,

Atsushi.









Reply via email to