I'm having a very frustrating time trying to get a database connection from
my mod_perl script using DBD::Informix.
System:
Redhat Enterprise Linux 4
IBM Informix Dynamic Server Version 10.00.UC3
Apache 2.0.52-28
mod_perl-2.0.1
DBI-1.40
DBD-Informix-2005.2-1
Stripped right down, my script now looks like this -
use Data::Dumper;
use DBD::Informix;
my $dbh = DBI->connect("dbi:Informix:$database", "$username",
"$password");
print "Database connection = $dbh<br>";
print "Error = $DBI::err, $DBI::errstr<br>";
And the results I get from running it are -
Database connection =
Error = -25560, SQL: -25560: Environment variable INFORMIXSERVER must be
set.
If I run the same script from the command line (rather than through
mod_perl) I get a database connection quite happily.
I've tried setting all the environment variables in the httpd.conf file -
SetEnv INFORMIXDIR /usr/informix
SetEnv INFORMIXSERVER bktester
SetEnv HOSTNAME bktester
SetEnv ONCONFIG onconfig
SetEnv INFORMIXC i386-glibc20-linux-gcc
SetEnv DBCENTURY C
which doesn't seem to change anything...
If I print out contents of %ENV immediately prior to trying to connect, all
the environment variables are there and correct, but I still get the same
error.
I am now completely at a loss...any ideas would be greatly appreciated.
Thanks
Jay
--
View this message in context:
http://www.nabble.com/mod_perl-and-DBD%3A%3AInformix-tf3673134.html#a10263786
Sent from the mod_perl - General mailing list archive at Nabble.com.