develooper Front page | perl.dbi.users | Postings from March 2005

Thanks. Working! Re: Re: RE: RE: DBI->Connect returning UNDEF in cgi but not in standalone prog

From:
Sunil A.V.
Date:
March 22, 2005 12:26
Subject:
Thanks. Working! Re: Re: RE: RE: DBI->Connect returning UNDEF in cgi but not in standalone prog
Message ID:
20050322202753.25298.qmail@webmail6.rediffmail.com
Guys,
Its working. Thanks all.
special thanks to Reidy Ron and Bill Costa.

The suggestion Ron gave was absolutely correct. There were a whole lot of env variables different/missing between the 2 environments.

The one which finally made it work was
$ENV{'TNS_ADMIN'} = '/var/opt/oracle/network/admin';

Thanks again,
Sunil
  


On Wed, 23 Mar 2005 Sunil A.V. wrote :
>As per Reidy, I printed $DBI::errstr and it turned out to be
>"Error: ORA-12154: TNS:could not resolve service name (DBD ERROR: OCIServerAttach) at myapp_utility.pm"
>
>This probably means Oracle SID or instance name which is 'ledmyapp' is not being recognized and is not there in tnsnames.ora
>But I confimed that tnsnames.ora has ledmyapp. Thats why standalone perl program worked from command line.
>
>So as per Ron and Bill, I also agree that environment variables might be incorrect. So I explicitly added
>$ENV{'ORACLE_HOME'}  = '/opt/oracle/product/9.2.0.6.0_64c';
>$ENV{'LD_LIBRARY_PATH'}  = '/opt/oracle/product/9.2.0.6.0_64c/lib';
>$ENV{'ORACLE_SID'}  = 'ledmyapp';
>$ENV{'PATH'} = $ENV{'PATH'}.":/opt/perl5/bin:/opt/oracle/product/9.2.0.6.0_64c/bin";
>
>I printed them also to confirm that additions are being recognized. It is BUT STILL I AM GETTING THE SAME ERROR.
>Do you think any other env variables might be missing OR is there a different way to set env vars for iPlanet web server perl cgi progs?
>
>
>
>On Wed, 23 Mar 2005 Bill.Costa@unh.edu wrote :
> >
> >      Ron.Reidy@arraybiopharma.com  recently wrote (in part):
> >
> > > The fact your code executes from the command line and not the web
> > > server indicates either a permissions problme or an environment
> > > problem.
> >
> >      I'll second that environment problem observation.  When something
> >      works from the command line but not as a CGI, that's one of the
> >      first things I check.  Here's an ugly Perl script that might
> >      be of use in comparing the two environments.
> >
> >
> >                                                       ...BC
> >
> >--
> >+----------------------------[ Bill.Costa@UNH.EDU ]---+
> >| Bill Costa                                          |
> >| CIS/TCS -- 1 Leavitt Lane    PHONE: +1-603-862-3056 |   No good deed...
> >| University of New Hampshire                         |    goes unpunished.
> >| Durham, NH  03824       USA                         |
> >|                                                     |
> >+-----------------[ http://pubpages.unh.edu/~wfc/ ]---+



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About