Apache, Oracle, Perl DBI Problems

From: Kevin Moore (kmoore_at_esntech.com)
Date: 12/12/03


Date: Thu, 11 Dec 2003 16:12:09 -0800
To: "'dbi-users@perl.org'" <dbi-users@perl.org>

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.



Relevant Pages

  • DBD::Oracle under IBM AIX
    ... I`m trying to connect to oracle:7.3.4 database ... via perl script but login failed. ... Error message as follows ... Linker and Libraries: ...
    (perl.dbi.users)
  • Re: Mail-merging with Word, MySQL... and Perl?
    ... Alt+F9 to toggle off their display. ... connection to my MySQL database on my Linux box. ... Or if a couple has its anniversary listed, I'll want to format ... the Perl script directly (which would be written to generate that data in ...
    (microsoft.public.word.mailmerge.fields)
  • Re: DBI with ORACLE encryption
    ... perl script to pull data out of the interface and dump the same to the ... All we do with oracle is to take an database connection ... other ways of connecting to database using dbi. ...
    (perl.dbi.users)
  • Memory fault(coredump) with two DBD type connections
    ... successfully connect to Oracle databases via a Perl script. ... can successfully connect to DB2 databases via a Perl script. ... when I try to connect to the same Oracle database AND same DB2 database ... 27203 Allow compiling swigged C++ code ...
    (perl.dbi.users)
  • DBI connect(db_local,,...) failed: at...
    ... able to obtain a connection to SQL Server -- or MS ... Access for that matter -- via cgi. ... The script works fine from the comman prompt, ... (note that there is no password associated with the DNS or database) ...
    (perl.dbi.users)