« TextMate macro to create stub perl script | Main | A quick note regarding instant messages... »
May 8, 2009
mod_perl DBD::Oracle and OCIEnvNlsCreate errors
To try and save the sanity of future generations (and my own when this happens to me again) I am summing up a host of issues I had getting DBD::Oracle and mod_perl to play nicely together.
In your mod_perl startup script do this:
BEGIN {
$ENV{ORACLE_HOME} = '/path/to/your/oracle/home';
$ENV{ORACLE_SID} = 'YOUR_SID';
}
Make sure if you load modules in your BEGIN block (like DBD::Oracle) they come after setting those environment variables.
Next, and this is the most annoying of all, make sure the web server user (nobody, www, whatever) has read access to the Oracle lib directory. In my case I added the 'www' user to the same group as the Oracle user. If the apache user can't read the oracle libs DBD::Oracle won't be able to connect and you get OCIEnvNlsCreate errors.
Hopefully this helps others avoid the hair pulling I went through trying to get this all working.
Posted by ed at May 8, 2009 12:17 PM