Problem: "use DBI" fails in html but not from command line.

Environment
   Sun Ultra 1, 1MB ram, Solaris  2.6
    ( SunOS mj1 5.6 Generic_105181-28 sun4u sparc SUNW,Ultra-1 )
   gcc version 2.95.3 20010315 (release)
   perl5 (revision 5.0 version 6 subversion 1)
   Apache: Apache/1.3.24 (Unix)
   mod_perl-1.26, (with HTML-Tagset-3.03, HTML-Parser-3.26,
                   MIME-Base64-2.12, URI-1.18, libwww-perl-5.64)
   DBI-1.21, DBD-mysql-2.1014, ApacheDBI-0.88, gdbm-1.8.0-sol26
 
   All builds (perl Makefile, make, make test, make install) good.
 
 
Description: Trying use DBI for MySQL and Apache.
 I can run a perl script which simply has the  "use DBI" all right
from the command line but I get an error when calling it as a cgi.
Since it does run successfully from cmd line, I feel the install
of the DBI is ok. Since it failes in the CGI, I paid particular
attention to section 4.4 at http://dbi.perl.org/doc/faq.html
 
 
I can only think of 2 problems at this point:
1) Soft links not followed when run from Apache.  I have linked /usr/local to
   a different drive (to get around some recent drive problems)
   (ln -s /t2/local /usr/local)
2) I am missing some environment variables.
 
Any assistance would be greatly appreciated,
Thank you in advance,
Karen Olsen
 
----------------------------------
Perl Script:
 
#!/usr/local/bin/perl -w
use strict; 
use CGI; 
use CGI::Carp qw( fatalsToBrowser );
use CGI qw(-debug);
#  uncommenting next line causes httpd problem, runs good from cmd line
# use DBI;
my $q = new CGI; 
my ($key, $val); 
print "Content-type: text/html\n\n";
print "<body bgcolor=white>";
while (($key, $val) = each %ENV) {
        print "$key = $val<BR>\n";
}
----------------------------------


----------------------------------
resulting error message:
Can't locate loadable object for module DBI in @INC (@INC contains: 
/usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 
/usr/local/lib/perl5/site_perl .) at 
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 223
BEGIN failed--compilation aborted at 
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 223.
Compilation failed in require at /www/cgi-bin/mysqltest line 4.
BEGIN failed--compilation aborted at /www/cgi-bin/mysqltest line 4.
----------------------------------


----------------------------------
Error from Apache log file (/t2/local/apache/logs/error_log):
Can't locate loadable object for module DBI in @INC (@INC contains: 
/usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 
/usr/local/lib/perl5/site_perl .) at 
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 223
BEGIN failed--compilation aborted at 
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 223.
Compilation failed in require at /www/cgi-bin/mysqltest line 3.
BEGIN failed--compilation aborted at /www/cgi-bin/mysqltest line 3.
[Thu Apr 25 10:56:59 2002] [error] [client qqq.qqq.qq.qq] Premature end of script 
headers: /www/cgi-bin/mysqltest
----------------------------------

----------------------------------
results of httpd -l:
qqq.root.#114#/t2/home/root>httpd -l
Compiled-in modules:
  http_core.c
  mod_env.c
  mod_log_config.c
  mod_mime.c
  mod_negotiation.c
  mod_status.c
  mod_include.c
  mod_autoindex.c
  mod_dir.c
  mod_cgi.c
  mod_asis.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_access.c
  mod_auth.c
  mod_setenvif.c
  mod_perl.c

----------------------------------


Reply via email to