On Jun 2, 2020, at 12:30 PM, Andreas Mock
<[email protected]<mailto:[email protected]>> wrote:
Hi Bruce,
only some hints. It sounds to me like a shared object mess which may be
possible after upgrading.
It may be something in my mod_perl environment.
I constructed a quick test script that queries the user table.
#!/usr/bin/perl
use strict;
use DBI;
use lib "/home/allwebfiles/perl/LocalModules";
use PharmApps::AllDefaults qw(PrintHeader);
my $dsn = "DBI:mysql:database=mysql;host=localhost;port=3306" ;
my $dbh = DBI->connect($dsn, ‘xxxxxx', ‘xxxxxx') or print $DBI::errstr;
my $csr= $dbh->prepare("select Host, User from user");
my ($i, $j);
$csr->execute();
print PrintHeader;
print "<table><tr><th>Host</th><th>User</th></tr>\n";
while (($i, $j) = $csr->fetchrow()){print "<tr><td>$i</td><td>$j</td></tr>\n";}
print "</table>\n";
print "<table><tr><th>\@INC</th></tr>\n";
foreach $i (sort @INC){print "<tr><td>$i</td></tr> \n";}
print "</table>";
On the command line it works without error. When I altered the settings to run
it as a cgi script (ie not with a mod_perl handler) it also works; it appears
that the error is only happening in the context of the script running in Apache
(with ModPerl enabled.)
Host User
% pharmacyevents
127.0.0.1 root
localhost pharmacyevents
localhost root
@INC
/home/allwebfiles/perl/LocalModules
/home/allwebfiles/perl/LocalModules/
/usr/lib64/perl5
/usr/lib64/perl5/vendor_perl
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/share/perl5
/usr/share/perl5/vendor_perl
The only difference I can see is that the @INC when it’s running in ModPerl is
that two additional paths are included:
@INC
/etc/httpd <<<<
/home/allwebfiles/perl/LocalModules
/home/allwebfiles/perl/LocalModules/
/usr/lib64/perl5
/usr/lib64/perl5/vendor_perl
/usr/lib64/perl5/vendor_perl/Bundle <<<<
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/share/perl5
/usr/share/perl5/vendor_perl
Adding those two paths to @INC (via 'use lib’ statements) doesn’t break the
script in CGI mode.
Very strange, because I cannot think of any reason that running it under
mod_perl would cause a problem with DBI, it doesn’t happen with any other
systems I’m running it on. I”m going to take this off to the mod_perl list, I
guess.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs