Click here to get back home

Problem with DBD::Oracle in cgi-script

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Problem with DBD::Oracle in cgi-script Marc F. Neininger 08-28-2007
Get Chitika Premium
Posted by Marc F. Neininger on August 29, 2007, 8:03 am
Please log in for more thread options


Peter Scott wrote:

>> install_driver(Oracle) failed: Can't load
>> '/usr/local/lib/perl/5.8.8/auto/DBD/Oracle/Oracle.so' for module
>> DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such
>> file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
>> at (eval 4) line 3 .
>
> Just passing by. Maybe check LD_LIBRARY_PATH and LD_RUN_PATH?
>

I set both variables to $ORACLE_HOME/lib.
Even hard coded it in the Makefile.PL .

What I really do not understand is that the driver works fine with
scripts that are executed from the shell...

Thanks for the answers

Marc

Posted by Peter Scott on August 30, 2007, 9:15 am
Please log in for more thread options


On Wed, 29 Aug 2007 14:03:07 +0200, Marc F. Neininger wrote:
> Peter Scott wrote:
>
>>> install_driver(Oracle) failed: Can't load
>>> '/usr/local/lib/perl/5.8.8/auto/DBD/Oracle/Oracle.so' for module
>>> DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such
>>> file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
>>> at (eval 4) line 3 .
>>
>> Just passing by. Maybe check LD_LIBRARY_PATH and LD_RUN_PATH?
>>
>
> I set both variables to $ORACLE_HOME/lib.
> Even hard coded it in the Makefile.PL .

Yes, but are they set when the CGI program runs?

I suggest you rewrite your Makefile.PL and link line to do without them.
I consider those variables evil and ban anyone working for me from using
them. They have been the source of countless annoying problems, and this
is starting to smell like one of them.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


Posted by Marc F. Neininger on August 31, 2007, 7:46 am
Please log in for more thread options


Peter Scott schrieb:
> On Wed, 29 Aug 2007 14:03:07 +0200, Marc F. Neininger wrote:
>> Peter Scott wrote:
>>
>>>> install_driver(Oracle) failed: Can't load
>>>> '/usr/local/lib/perl/5.8.8/auto/DBD/Oracle/Oracle.so' for module
>>>> DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such
>>>> file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
>>>> at (eval 4) line 3 .
>>> Just passing by. Maybe check LD_LIBRARY_PATH and LD_RUN_PATH?
>>>
>> I set both variables to $ORACLE_HOME/lib.
>> Even hard coded it in the Makefile.PL .
>
> Yes, but are they set when the CGI program runs?
>
> I suggest you rewrite your Makefile.PL and link line to do without them.
> I consider those variables evil and ban anyone working for me from using
> them. They have been the source of countless annoying problems, and this
> is starting to smell like one of them.
>

Hi Peter,

I refreshed the DBD::Oracle package and rebuilt it. I will have to look
how a patch is created as the very first error message is just that the
version string of Debian's perl installation contains a point and an
underscore...

The problem with the "not found" lib was solved as I had to "755" the
lib directory (was I think 710 by default). I wrote out the whole
environment of the shell I was able to work with my scheme and rebuilt
the whole environment via SetEnv policy for the apache alias.

Thanks for your answer

Marc

Posted by Mumia W. on August 29, 2007, 9:17 am
Please log in for more thread options


On 08/29/2007 03:17 AM, Marc F. Neininger wrote:
>
> That's one of the problems. For Oracle you have to set the ORACLE_SID
> and ORACLE_HOME variables for the calling shell (aka Apache Environment).
>
> I set those variables via $Env und $Env in the
> script before connecting to the DB but the problem might be deeper
> inside. The driver links against an Oracle lib that is not found at
> runtime. So I compiled the driver another time and got some mistakes like
> [...]

Probably those variables must be set at compile time rather than run time:

BEGIN {
$ENV = "...";
$ENV = "....";
}
use DBD::Oracle;
use DBI;

However, setting the variables in the Apache config file is the Right
Way(TM).


Posted by Marc F. Neininger on August 29, 2007, 12:42 pm
Please log in for more thread options


Mumia W. wrote:

> However, setting the variables in the Apache config file is the Right
> Way(TM).
>
Yes. I did it and I could change the error message twice :-)
First I found out that there was no read acces for World and the Error
message changed.

Afterwards the Error Message changed to "ERROR OCIEnvNlsCreate. Check
ORACLE_HOME env var, NLS settings, permissions, etc."

I set the ENV in the Apache conf. file via

SetEnv LD_LIBRARY_PATH /u01/app/oracle/lib
SetEnv ORACLE_HOME /u01/app/oracle
SetEnv ORACLE_SID ORAPARA
SetEnv NLS_LANG AMERICAN_AMERICA.WE8ISO8859P1
SetEnv NLS_CHARACTERSET WE8ISO8859P1
SetEnv NLS_NCHAR_CHARACTERSET AL16UTF16

and looked that the parameters fit to the databases NLS_values (SELECT *
from NLS_DATABASE_PARAMETERS;)
.

But no luck.

Till tomorrow and Thanks for all the hints

Marc

Similar ThreadsPosted
Problem installing DBD-Oracle June 5, 2008, 5:44 pm
Perl DBI Oracle Problem with Apache 2.0.46 January 19, 2005, 2:29 am
Problem building DBD::Oracle on 64 bit solaris April 13, 2005, 2:51 pm
DBD::Oracle and various oracle clients August 1, 2006, 9:23 am
DBD::Oracle June 15, 2006, 3:22 am
DBD::Oracle on cygwin July 12, 2006, 6:09 am
DBD::Oracle issues January 23, 2007, 7:16 pm
DBI/DBD-Oracle and Proxy June 13, 2007, 11:43 am
Using DBD::pNET with DBD::Oracle August 23, 2007, 8:54 pm
DBI and DBI::Oracle packages configuration July 22, 2004, 8:55 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap