Home > Archive > PERL Modules > June 2005 > DBI - DBD-DB2 Problem - Please help
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
DBI - DBD-DB2 Problem - Please help
|
|
| Dieter Brensteiner 2005-06-02, 8:55 pm |
| Hi !
I can run my index.cgi program without error against a DB2 Database from
command line !
There are no errors at all.
When I try to run the index.cgi file on my apache redhat ws4 i get the
following error:
install_driver(DB2) failed: Can't load
'/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/DB2/DB2.so'
for module DBD::DB2: libdb2.so.1: cannot open shared object file: No
such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /var/www/htdocs/csc/index.cgi line 113
Please can anybody help ? Urgently
thanx guys...
| |
| Jonathan Leffler 2005-06-03, 3:55 am |
| Dieter Brensteiner wrote:
> I can run my index.cgi program without error against a DB2 Database from
> command line ! There are no errors at all.
Good - so you know what the correct environment should be.
> When I try to run the index.cgi file on my apache redhat ws4 i get the
> following error:
>
> install_driver(DB2) failed: Can't load
> '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/DB2/DB2.so'
> for module DBD::DB2: libdb2.so.1: cannot open shared object file: No
> such file or directory at
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
> at (eval 3) line 3
> Compilation failed in require at (eval 3) line 3.
> Perhaps a required shared library or dll isn't installed where expected
> at /var/www/htdocs/csc/index.cgi line 113
>
>
> Please can anybody help ? Urgently
Most likely, the environment that works on the command line is not
available in the web server environment. Look up the PassEnv and SetEnv
directives.
(The odds that a problem of the form 'it works on the command line and
not via a web server' is caused by faulty environment settings are
astoundingly high; it covers more than 99% of the cases I've seen.)
In case of doubt, write a web page that dumps the environment it
receives. Then compare that with your working environment. The problem
will, most likely, be obvious.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/
| |
| Dieter Brennsteiner 2005-06-03, 3:55 am |
| Thankx for ya help so far.
Well that´s what I tought it would be but, we were setting alle
environments in our cgi already:
$ENV{'PATH'} =
'/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/home/db2p/sqllib/bin:/home/db2p/sqllib/adm:/home/db2p/sqllib/misc';
$ENV{'LD_LIBRARY_PATH'} = '/usr/IBMdb2/V6.1/lib';
$ENV{'DB2DIR'} = '/usr/IBMdb2/V6.1';
$ENV{'DB2INSTANCE'} = 'db2p';
$ENV{'CLASSPATH'} =
'/home/db2p/sqllib/java/db2java.zip:/home/db2p/sqllib/java/runtime.zip:/home/db2p/sqllib/java/sqlj.zip';
Do we have to set some env in the httpd.conf of our apache ??
Thanx
Jonathan Leffler schrieb:
> Dieter Brensteiner wrote:
>
>
>
> Good - so you know what the correct environment should be.
>
>
>
> Most likely, the environment that works on the command line is not
> available in the web server environment. Look up the PassEnv and SetEnv
> directives.
>
> (The odds that a problem of the form 'it works on the command line and
> not via a web server' is caused by faulty environment settings are
> astoundingly high; it covers more than 99% of the cases I've seen.)
>
> In case of doubt, write a web page that dumps the environment it
> receives. Then compare that with your working environment. The problem
> will, most likely, be obvious.
>
>
| |
| Dieter Brennsteiner 2005-06-03, 8:58 am |
| Jonathan Leffler schrieb:
> Dieter Brensteiner wrote:
>
>
>
> Good - so you know what the correct environment should be.
>
>
>
> Most likely, the environment that works on the command line is not
> available in the web server environment. Look up the PassEnv and SetEnv
> directives.
>
> (The odds that a problem of the form 'it works on the command line and
> not via a web server' is caused by faulty environment settings are
> astoundingly high; it covers more than 99% of the cases I've seen.)
>
> In case of doubt, write a web page that dumps the environment it
> receives. Then compare that with your working environment. The problem
> will, most likely, be obvious.
>
>
Thankx for your help, found the error which was the Setenv
LD_LIBRARY_PATH in the httpd.conf.
Thanks again, see ya
|
|
|
|
|