You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kevin Old <ko...@kold.homelinux.com> on 2003/12/11 04:42:34 UTC
mod_perl using different ODBC driver manager
Hello everyone,
First, please forgive the cross-post, but it's hard to decide which list
this belongs too.
I'm running RH 7.3, Apache 1.3.26, mod_perl 1.26, Perl 5.6.1 all
installed/upgraded from RH. Using the Single-Tier Format ODBC driver(s)
(5.1) from openlinksw.com connecting to a MS SQL Server 2000. Running
DBD::ODBC 1.06, Apache::DBI 0.92, and DBI 1.39.
The unixODBC Driver Manager came with RH 7.3 and the Openlink drivers
have the iODBC DM that it uses. I compiled DBD::ODBC to use the iODBC
DM. ODBCHOME is set to the appropriate path.
First, let me state that mod_perl and all of the DBI related drivers are
working quite well.
I am able to setup a DSN and use it successfully via a "regular" perl
script, but when I try to have Apache::DBI connect to it in my
startup.pl I get a message in the log stating that the DSN wasn't
defined in the unixODBC DM. This is correct, but why is mod_perl using
the unixODBC DM instead of the iODBC DM? My suspicion is that mod_perl
and unixODBC came as RPMs with RH 7.3 and they were already "linked"
together. I've tried providing all of the ENV variables (ODBCHOME
included) that are set in the users .bash_profile in relation to the
OpenLink Drivers, but that doesn't seem to do any good.
If I need to post logs, etc. just let me know.
Can anyone offer any suggestions?
Thanks,
Kevin
--
Kevin Old <ko...@kold.homelinux.com>
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl using different ODBC driver manager
Posted by Perrin Harkins <pe...@elem.com>.
On Thu, 2003-12-11 at 17:04, Kevin Old wrote:
> Thanks for your reply. I'm explicitly setting them in my startup.pl as
> below....isn't that the same as the PerlPassEnv directive?
Pretty much. I'd suggest modifying your copy of Apache::DBI so that it
logs the value of these %ENV settings whenever a new connection is
opened. That way you can verify that they are set properly when they
are used.
- Perrin
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl using different ODBC driver manager
Posted by Kevin Old <ko...@kold.homelinux.com>.
On Thu, 2003-12-11 at 16:47, Perrin Harkins wrote:
> On Wed, 2003-12-10 at 22:42, Kevin Old wrote:
> > I am able to setup a DSN and use it successfully via a "regular" perl
> > script, but when I try to have Apache::DBI connect to it in my
> > startup.pl I get a message in the log stating that the DSN wasn't
> > defined in the unixODBC DM. This is correct, but why is mod_perl using
> > the unixODBC DM instead of the iODBC DM
>
> I don't much about the ODBC stuff you're referring to, but make sure
> your environment variables are really getting set. They will not be
> passed to mod_perl unless you put PerlPassEnv directives for them in
> httpd.conf. Try dumping %ENV in your script to see if they are set or
> not.
Perrin,
Thanks for your reply. I'm explicitly setting them in my startup.pl as
below....isn't that the same as the PerlPassEnv directive?
#!/usr/bin/perl
use DynaLoader();
use warnings;
use strict;
# Extend @INC if needed
#use lib qw(/dir/foo /dir/bar);
use lib qw(/var/www/html/mason/lib);
use lib qw(/var/www/html/mason/hrtime/lib);
use vars qw($dbh %session $sid);
#Shell ENV vars for Openlink ODBC driver
$ENV{ODBCINI} = "/usr/openlink/bin/odbc.ini";
$ENV{ODBCINSTINI} = "/usr/openlink/bin/odbcinst.ini";
$ENV{OPENLINKINI} = "/usr/openlink/bin/openlink.ini";
my $tmppath = $ENV{PATH};
$ENV{PATH} = "/usr/openlink/bin:/usr/openlink/samples/ODBC:$tmppath";
$ENV{LD_LIBRARY_PATH} = "/usr/openlink/lib";
$ENV{LIBPATH} = "/usr/openlink/lib";
$ENV{SHLIB_PATH} = "/usr/openlink/lib";
$ENV{OPL_LOCALEDIR}="/usr/openlink/locale";
$ENV{ODBCHOME} = "/usr/openlink/odbcsdk";
[rest of startup.pl]
Any ideas?
Thanks,
Kevin
--
Kevin Old <ko...@kold.homelinux.com>
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl using different ODBC driver manager
Posted by Perrin Harkins <pe...@elem.com>.
On Wed, 2003-12-10 at 22:42, Kevin Old wrote:
> I am able to setup a DSN and use it successfully via a "regular" perl
> script, but when I try to have Apache::DBI connect to it in my
> startup.pl I get a message in the log stating that the DSN wasn't
> defined in the unixODBC DM. This is correct, but why is mod_perl using
> the unixODBC DM instead of the iODBC DM
I don't much about the ODBC stuff you're referring to, but make sure
your environment variables are really getting set. They will not be
passed to mod_perl unless you put PerlPassEnv directives for them in
httpd.conf. Try dumping %ENV in your script to see if they are set or
not.
- Perrin
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html