Re: Problems with dbi:Oracle
"Martin J. Evans" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.general |
|---|---|
| Organization | Easysoft Limited |
| Message-ID | <[email protected]> |
On 24/01/13 19:03, Bruce Johnson wrote: > > On Jan 21, 2013, at 3:08 PM, Alexander Foken <[email protected]> > wrote: > >> You seem to run from a CGI environment. Look at the http server >> error log for details of the error. >> >> Note that Oracle may depend on some environment variables that are >> NOT available by default when running in the context of the http >> server. >> >> Try to debug with a simple command line script instead of a CGI >> first, then blame DBI or DBD::Oracle. > > > What Alexander said. > > Any script that uses Oracle via DBI must have at least the > $ORACLE_HOME and $LD_LIBRARY_PATH environment vars available. That is no longer strictly true. If you use instant client you do not need ORACLE_HOME set and in fact, if you do set it with some older versions of instant client it causes problems (I had to change Makefile.PL a few years back to fix this as it was stopping sqlplus from running properly so the Makefile.PL fell back on assuming I had Oracle 8 - which I did not). If you are using a full Oracle install then you should definitely set ORACLE_HOME and recently this has got harder because a basic oracle installation does not include all the files DBD::Oracle requires to build. > In Apache you can pass specified environment vars from the user who > starts the Apache httpd processes in a directive, SetEnv: > > #PassEnv PATH SetEnv LD_LIBRARY_PATH > /usr/lib/oracle/11.2/client64/lib SetEnv ORACLE_HOME > /usr/lib/oracle/11.2/client64 > > This is for linux-based Oracle Instant Client. > That's a newer instant client which does not seem to mind ORACLE_HOME being set but it is not necessary. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com