On Thu, Dec 11, 2003 at 08:29:14PM -0800, Kevin Moore wrote:
> >Hi Steve,
> >
> >I can run the scripts from the command line. The script connects to 
> >the database with no questions asked and selects data from tables. I'm 
> >pretty sure the problem is with Apache interfacing with Perl/DBI. My 
> >problem is knowing what to do to fix this. Should environments such as 
> >LD_LIBRARY_PATH be set in the Apache configuration or what?

Yes.

Tim.

> I'm new to 
> >this area as you can tell. I'm looking for somebody who has made this 
> >work to point me in the right direction. Any pointers are appreciated. 
> >Thanks.
> >
> >Kevin
> 
> 
> 
> Steve Baldwin wrote:
> 
> >Did you try executing your Perl CGI script from the command line (as
> >opposed to via the web server) ?  None of our CGI scripts set
> >LD_LIBRARY_PATH, (although we use Apache 1 not 2).  Could it be a
> >permissions thing ?  Did you confirm that the Oracle client library is
> >present and accessible ?  If the cgi executes from the command line,
> >maybe it's an Apache setup thing rather than a DBI thing.
> >
> >-----Original Message-----
> >From: Kevin Moore [mailto:[EMAIL PROTECTED] 
> >Sent: Friday, 12 December 2003 11:12 AM
> >To: '[EMAIL PROTECTED]'
> >Subject: Apache, Oracle, Perl DBI Problems
> >
> >
> >Gang,
> >
> >I'm attempting to write a perl script, callable from a URL, that 
> >connects me to an Oracle 9i database. I've combed the help pages and 
> >think i'm just missing something simple. From what i've read it appears 
> >that my LD_LIBRARY_PATH is not being set correctly. I've set the 
> >LD_LIBRARY_PATH variable in the perl script and installed the DBI 
> >modules. Below is the environment, code snippet, and error message. Any 
> >ideas anyone? Completely lost here. - Kevin
> >
> >Environment:
> >
> >Red Hat Linux 9.0
> >Apache 2.0.40
> >Apache-DBI-0.91
> >DBD-Oracle-1.14
> >DBI-1.35
> >
> >Code Snippet:
> >
> >#!/usr/bin/perl -w
> >
> >use strict "subs";
> >use Apache::DBI;
> >use DBI;
> >use DBD::Oracle;
> >use CGI;
> >use CGI::Carp qw(fatalsToBrowser);
> >use CGI::Cookie;
> >#use Apache::Registry;
> >
> >package CGIBook::Error;
> >
> >use vars qw( $dbh $CGI $TABLE $q $r @FIELD_NAMES);
> >
> >my ( $sth, @row );
> >
> >@FIELD_NAMES = ("uinp_uname", "uinp_fname", "uinp_lname", "uinp_active",
> >               "uinp_email", "uinp_passwd", "uinp_signup",
> >"last_login",
> >               "conf_passwd");
> >
> >$TABLE = "webusers";
> >$ENV{'ORACLE_HOME'} = '/home/oracle/product/9ias';
> >#$ENV{'LD_LIBRARY_PATH'} = '/home/oracle/product/9ias/lib';
> >$ENV{'TWO_TASK'} = 'webapp'; $ENV{'LD_RUN_PATH'} = 
> >"/home/oracle/product/9ias/lib:/home/oracle/product/9ias/r
> >dbms/lib";
> >
> >LD_LIBRARY_PATH = '/home/oracle/product/9ias/lib';
> >
> ># $CGI = new CGI();
> >
> >### Connect To Database
> >
> >my $dbh = DBI->connect( "dbi:Oracle:WEBAPP.WORLD", "user", "password" ,
> >{
> >       PrintError => 0,
> >       RaiseError => 0
> >       } ) or die "Can't connect To Database: $DBI::errstr\n";
> >
> >Error message:
> >
> >[error] [client 192.168.1.3] Premature end of script headers: signup.cgi
> >[Thu Dec 11 16:01:14 2003] [error] [client 192.168.1.3] Can't load 
> >'/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBD/Oracle/
> >Oracle.so' 
> >for module DBD::Oracle: libclntsh.so.8.0: cannot open shared object 
> >file: No such file or directory at 
> >/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229.
> >[Thu Dec 11 16:01:14 2003] [error] [client 192.168.1.3]  at 
> >/home/httpd/cgi-bin/signup.cgi line 6
> >[Thu Dec 11 16:01:14 2003] [error] [client 192.168.1.3] Compilation 
> >failed in require at /home/httpd/cgi-bin/signup.cgi line 6. [Thu Dec 11
> >16:01:14 2003] [error] [client 192.168.1.3] BEGIN 
> >failed--compilation aborted at /home/httpd/cgi-bin/signup.cgi line 6.
> >
> >
> >
> >
> > 
> >
> 
> 

Reply via email to