Operating System - HP-UX
1845906 Members
4599 Online
110250 Solutions
New Discussion

Re: Problem with perl module, running the script under apache

 
Katsioulis Alexandros
Respected Contributor

Problem with perl module, running the script under apache

Hi to all.

I have the following problem.
I use a small perl script to connect to an Oracle database, to retrieve some data and present it on a web interface (cgi script). The script uses DBI and the Oracle DBD driver. When I execute from command line, everything works fine, put when executed from Apache (web browser request), I get the following error :

install_driver(Oracle) failed: Can't load '/opt/perl64/lib/site_perl/5.8.3/PA-RISC2.0-LP64/auto/DBD/Oracle/Oracle.sl' for module DBD::Oracle: No such file or directory at /opt/perl64/lib/5.8.3/PA-RISC2.0-LP64/DynaLoader.pm line 229.
at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /opt/OV/httpd/cgi-bin/post/reports/post.cgi line 371

I have included the paths to
LD_LIBRARY_PATH
LD_RUN_PATH
PERL5LIB
and @INC contains all the necessary paths.

The UNIX box has
HP-UX 11.11
Apache 1.3.27
Oracle 9.2.0.4 64bit
Perl 5.8.3 64bit
DBI 1.40
DBD:Oracle 1.16

I would appreciate any help.

Thanks in advance,
Alex
1 REPLY 1
Katsioulis Alexandros
Respected Contributor

Re: Problem with perl module, running the script under apache


Finally, after some days, I found out the problem.

I had to add the following on the httpd.conf file of apache.

SetEnv LD_LIBRARY_PATH /usr/local/lib:$ORACLE_HOME/lib

SetEnv LD_RUN_PATH /usr/local/lib:$ORACLE_HOME/lib

I would like to thank my unix guru, gdp for his help.