rsennat has asked for the wisdom of the Perl Monks concerning the following question:

hi all,

my application on cgi/perl with DBI works fine.

but on mod_perl 2.0.2 over Apache 2 gives this error,

error happened: connect Can't connect to dbi:Oracle: ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.).

what could be the problem??? I did few settings in the httpd.conf, to have ORACLE_HOME, ORACLE_SID, NLS_LANG, TNS_ADMIN. But nothing worked out.

thanks,
rsennat

Replies are listed 'Best First'.
Re: mod_perl DBI error
by ptum (Priest) on Dec 02, 2005 at 20:55 UTC
    Hmmm. We might need a little more information.

    Here is a wild guess:

    As you may know, in order to pass environment variables to a CGI script, you have to set them explicitly in your httpd.conf. I spent a long time recently banging my head on a similar problem. Can you show us your settings in httpd.conf for the relevant directory(ies)? You might also consider modifying your application so that it displays the values of the environment parameters you expect to be set. Example:
    <Directory /blah/blah/blah> Options All MultiViews ... PassEnv LD_LIBRARY_PATH PassEnv ORACLE_HOME </Directory>

    No good deed goes unpunished. -- (attributed to) Oscar Wilde
Re: mod_perl DBI error
by rsennat (Beadle) on Dec 05, 2005 at 15:09 UTC
    The problem was resolved when I put the ENV VARS, ORACLE_HOME, ORACLE_SID, NLS_LANG, TNS_ADMIN - in startup.pl of Apache.

    Thanks
    rsennat