Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Oracle DBD problems with mod_perl

by JupiterCrash (Monk)
on Sep 08, 2004 at 14:55 UTC ( #389390=perlquestion: print w/ replies, xml ) Need Help??
JupiterCrash has asked for the wisdom of the Perl Monks concerning the following question:

I have a perl application which uses the Oracle DBD to connect to Oracle. It connects and works fine when using perl.

When running this same application under mod_perl, I get the following error on connection:

(UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc.

I dump the environment on error, and the ORACLE_HOME, ORACLE_SID, and LD_LIBRARY_PATHS are all correct. These are the only Oracle-related environment variables that are set, and they are set by the application. They're the same in both the perl and mod_perl environments.

What could be different in the mod_perl environment that is causing this to fail? I checked the @INC, and it appears to be getting the same Oracle.pm and Oracle.so as when the app is ran in a perl environment.

I'd love to hear any suggestions, I haven't had much luck with this and haven't found any information online. What am I missing?

Also, note that it does work using MySQL under mod_perl. It is just Oracle which is giving me problems.

Thanks!

Comment on Oracle DBD problems with mod_perl
Re: Oracle DBD problems with mod_perl
by dragonchild (Archbishop) on Sep 08, 2004 at 15:29 UTC
    Try setting $ENV{ORACLE_HOME} in your startup.pl. I tried every iteration of this, and setting it in the actual handler/script didn't work. I ended up having to set it before use'ing DBI, even.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

      I have had the same experience dragonchild, very frustrating -- I thought I was the only one. ++


      -Waswas
        THANK YOU BOTH! This worked.

        Here's the crazy part. I had this same idea yesterday, tried it, and no luck. I can't figure out what I did differently yesterday when it didn't work, because I even removed the environment from being set in my script so that when the error dumped the environment, I proved to myself that it was set by the startup.pl. Must have been a typo or something in the environment yesterday.

        Anyhow, this is great. Thanks again!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://389390]
Approved by blahblahblah
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-07-26 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (178 votes), past polls