Re: Need Help : DBI works with Perl but doesn't works with CGI
hi Apachez
i tried to locate the error onto the log/error file and what i found is:
----------
client 127.0.0.1: Premature end of script headers: c:/phpdev/www/cgi-bin/two.cgi
client 127.0.0.1: Can't locate loadable object for module DBI in @INC (@INC contains: c:/phpdev/PERL/lib c:/phpdev/PERL/site/lib .) at c:/phpdev/PERL/lib/DBI.pm line 255
client 127.0.0.1: BEGIN failed--compilation aborted at c:/phpdev/PERL/lib/DBI.pm line 255.
client 127.0.0.1: Compilation failed in require at c:\phpdev\www\cgi-bin\two.cgi line 4.
client 127.0.0.1: BEGIN failed--compilation aborted at c:\phpdev\www\cgi-bin\two.cgi line 4.
----------
moreover the program is modified as :
-----------
#!c:/phpdev/perl/bin/perl.exe
use strict;
use DBI;
use warnings(FATAL=>'all');
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
print header(), start_html('CGI-DBI');
my $dbh = DBI->connect('dbi:mysql:test','root','password');
if (!defined($dbh)) {
print h2('Can\'t connect');
die "Can't connect \n";
}
print h2('connected'), br();
$dbh->disconnect();
print h3('disconnected'), end_html();
--------------
i tried the program on command-line and as usual it's running there but with Internet Explorer its gives the same "Internal Server Error".
waiting for a reply
regards
Sethi
Subject
Written By
Posted
Re: Need Help : DBI works with Perl but doesn't works with CGI
May 04, 2006 02:29AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.