I am having a problem linking to Oracle via apache.
I can link to the db through the perl script under linux successfully. But I cannot execute it through the web. The error message is:
"DBI connect('db','user',...) failed: ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc"

Then I tried the following:
1. On purpose, I set up the "WRONG" ORACLE_HOME in the script. when I execute the perl script, as I expected, the connection to the db failed. The same error message displayed:
"DBI connect('db','user',...) failed: ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc"

2. I just print $ENV{'ORACLE_HOME'} on the web and the ORACLE_HOME env is right (I defined it in the httpd.conf file). But the connection still not working.

Here is my code:
use strict;
use CGI;
use DBI;
use DBD::Oracle;
my $q = new CGI;
print $q->header("text/html");
$ENV{'ORACLE_HOME'} = "/opt/oracle/OraHome_1";

my ($dbh);
my ($dbs, $u, $passwd) = ("dbi:Oracle:hostname", "usr", "passwd");
eval {$dbh = DBI->connect($dbs, $u, $passwd,
{PrintError => 1, RaiseError => 1, AutoCommit => 1})};
if ( $@ ) { print qq("connect error:home is $dbs, $u, $passwd, $@, $DBI::errstr");}
...

Thanks!