Try defining the environment variables inside the Perl script, not the
Apache configuration...
The Perl I copied this from doesn't use DBI::DB2, but the idea is the same...
#config environment for db2 access.
$ENV{DB2DIR} ="/usr/lpp/db2_06_01";
$ENV{DB2INSTANCE} = "db2inst1";
$ENV{INSTHOME} = "/home/db2inst1";
$ENV{LD_LIBRARY_PATH} = ":/home/db2inst1/sqllib/lib";
$ENV{PATH}
="/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/local/bin:
/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc";
$ENV{CLASSPATH} =
":/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib
/java/runtime.zip:/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/j
ava/runtime.zip:";
-JD.
At 4:40 AM -0500 1/15/02, [EMAIL PROTECTED] wrote:
>Hi,
>
>I am using DBI and DBD::DB2 in a perl script to connect to a db2 database and
>retrieve some data from a
>table. It works fine in a shell using a normal user including root and wwwrun.
>It doesnt' work at all when I call the script as a cgi. I am using apache
>1.3.12
>which runs as wwwrun.
>I get an error message
>
>"DBI->connect(dsnt) failed: Total Environment allocation failure! Did you set
>up your DB2 client environment? at /home/www/cgi-bin/db2.pl line 48"
>
>I included the "db2profile" from /home/<db2user>/sqllib into the apache script
>but this doesn't seem to have any effect.
>
>best regards,
>Thomas