You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by jw...@comcast.net on 2005/02/09 19:53:50 UTC
mod_perl - DBD::Oracle exec format error for Oracle.sl
I spent quite a bit of time getting DBD::Oracle to install on this
HP-UX B.11.00 E 9000/800 box. I followed the instructions in
README.hpux in the DBD::Oracle installation directory. Within this
readme is also instructions for getting Apache and mod_perl running.
I ended up with a new perl (output below) which needed to be linked to
libpthread (although the perl executable is not multithreaded). I
then built Apache and mod_perl.
In short, without mod_perl, everything works fine. I can connect to
Oracle, do queries, etc as a normal CGI process. However, when I
compile and install mod_perl, I get the following error in the apache
error_log:
[Tue Feb 8 14:21:05 2005] [error] install_driver(Oracle) failed: Can't load
'/post/opt/perl-5.8.0/lib/site_perl/5.8.0/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl'
for module DBD::Oracle: Exec format error at
/post/opt/perl-5.8.0/lib/5.8.0/PA-RISC2.0/DynaLoader.pm line 229.\n at (eval 12)
line 3\nCompilation failed in require at (eval 12) line 3.\nPerhaps a required
shared library or dll isn't installed where expected\n at
/post/home/post/migr/pos/bin/db_test.cgi line 12\n
Perl, Apache, DBD::Oracle and mod_perl were all built with the same compiler / linker options so I am at a loss as to what could be causing this loader problem.
Since the database connection works until I installed mod_perl, I am
thinking the compile of mod_perl is somehow unable or incompatbile
with the Oracle DBD shared library.
mod_perl does seem to work as long as I am not trying to make a DBD connection.
*) I built Apache like this (note the -lpthread and -lcl required by
HPUX 11):
LDFLAGS_SHLIB_EXPORT="" \
LDFLAGS="-lm -lpthread -lcl " \
CC=/usr/bin/cc \
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" \
./configure \
--prefix=$PH/apache \
--enable-shared=max \
--disable-rule=EXPAT \
--enable-module=info \
--enable-rule=SHARED_CORE
*) And mod_perl next like this:
perl Makefile.PL NO_HTTPD=1 USE_APXS=1 WITH_APXS=/$PH/apache/bin/apxs
EVERYTHING=1
*) Does 'make test' pass 100%? Can't make test with APXS
*) Does your script still work under CGI? YES
*) Apache version: 1.3.33
*) mod_perl version: 1.29
*) Here is the test script:
use DBI;
use CGI;
use POSIX;
$query = new CGI();
print $query->header();
$dbh = DBI->connect('dbi:Oracle:post','user,'pass') || die DBI->error_str;
$st = $dbh->prepare("select * from users");
$st->execute() || die $dbh->error_str;
while (@row = $st->fetchrow_array) {
print @row,"\n";
}
*) Relevant config from httpd.conf:
PerlSetEnv ORACLE_HOME /post/opt/oracle9.2
PerlSetEnv ORACLE_SID post
PerlSetEnv LD_LIBRARY_PATH /post/opt/oracle9.2/lib
Alias /cgi-bin/ "/post/home/post/migr/pos/bin/"
PerlModule Apache::Registry
<Location /cgi-bin>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Location>
*) perl -V:
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=hpux, osvers=11.00, archname=PA-RISC2.0
uname='hp-ux hxffcn3 b.11.00 e 9000800 698359356 8-user license '
config_args='-Ubincompat5005 -Duselargefiles -A prepend:libswanted=cl
pthread -Dprefix=/post/opt/perl-5.8.0'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags =' +z -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ',
optimize='+O2 +Onolimit',
cppflags='-Aa -D__STDC_EXT__ -D_HPUX_SOURCE +z -Ae -D_HPUX_SOURCE
-Wl,+vnocompatwarnings -I/usr/local/include'
ccversion='A.11.01.25171.GP', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='/usr/bin/ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lcl -lpthread -lnsl -lnm -lndbm -lmalloc -ldld -lm -lc -lndir -lcrypt
-lsec
perllibs=-lcl -lpthread -lnsl -lnm -lmalloc -ldld -lm -lc -lndir -lcrypt
-lsec
libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
cccdlflags='+Z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under hpux
Compiled at Dec 21 2004 16:48:13
%ENV:
PERL5LIB="/post/home/post/migr/pos/lib"
@INC:
/post/home/post/migr/pos/lib
/post/opt/perl-5.8.0/lib/5.8.0/PA-RISC2.0
/post/opt/perl-5.8.0/lib/5.8.0
/post/opt/perl-5.8.0/lib/site_perl/5.8.0/PA-RISC2.0
/post/opt/perl-5.8.0/lib/site_perl/5.8.0
/post/opt/perl-5.8.0/lib/site_perl
.
Re: mod_perl - DBD::Oracle exec format error for Oracle.sl
Posted by Perrin Harkins <pe...@elem.com>.
On Wed, 2005-02-09 at 18:53 +0000, jwarn2@comcast.net wrote:
> I spent quite a bit of time getting DBD::Oracle to install on this
> HP-UX B.11.00 E 9000/800 box. I followed the instructions in
> README.hpux in the DBD::Oracle installation directory. Within this
> readme is also instructions for getting Apache and mod_perl running.
> I ended up with a new perl
Did you rebuild DBD::Oracle for this new perl?
- Perrin
Re: mod_perl - DBD::Oracle exec format error for Oracle.sl
Posted by Silvio Wanka <Si...@alcatel.de>.
jwarn2@comcast.net wrote:
> I spent quite a bit of time getting DBD::Oracle to install on this
> HP-UX B.11.00 E 9000/800 box. I followed the instructions in
> README.hpux in the DBD::Oracle installation directory. Within this
> readme is also instructions for getting Apache and mod_perl running.
> I ended up with a new perl (output below) which needed to be linked to
> libpthread (although the perl executable is not multithreaded). I
> then built Apache and mod_perl.
>
> In short, without mod_perl, everything works fine. I can connect to
> Oracle, do queries, etc as a normal CGI process. However, when I
> compile and install mod_perl, I get the following error in the apache
> error_log:
>
>
> [Tue Feb 8 14:21:05 2005] [error] install_driver(Oracle) failed: Can't load
> '/post/opt/perl-5.8.0/lib/site_perl/5.8.0/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl'
> for module DBD::Oracle: Exec format error at
> /post/opt/perl-5.8.0/lib/5.8.0/PA-RISC2.0/DynaLoader.pm line 229.\n at (eval 12)
> line 3\nCompilation failed in require at (eval 12) line 3.\nPerhaps a required
> shared library or dll isn't installed where expected\n at
> /post/home/post/migr/pos/bin/db_test.cgi line 12\n
>
> Perl, Apache, DBD::Oracle and mod_perl were all built with the same compiler / linker
> options so I am at a loss as to what could be causing this loader problem.
>
> Since the database connection works until I installed mod_perl, I am
> thinking the compile of mod_perl is somehow unable or incompatbile
> with the Oracle DBD shared library.
if it works with perl but not with mod_perl then IMO the apache binary is not
proper build for H-UX Oracle. Please check via
chattr <apache-sbin>/httpd
that you find in the "shared library list:" section
/usr/lib/libpthread.1
and
/usr/lib/libcl.1
if shared library list of
chattr /post/opt/perl-5.8.0/lib/site_perl/5.8.0/PA-RISC2.0/auto/DBD/Oracle/Oracle.sl
also contains /usr/lib/libcl.1. Both library must be linked to the main-programm if a
shared lib or object needs it. Strange or simpler HP-UX ;-).
regards, Silvio