473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

error in perl with mysql

hai,

in my program i used the DBI module

my program running well in terminal(redhat linux 9.0)

if i use the same program in interface (use CGI)
that time it shows the log error

[Mon Nov 27 20:29:35 2006] [error] [client] BEGIN failed--compilation aborted at /home/httpd/cgi-bin/mysql_kalai/selectPdb.pl line 9.
[Mon Nov 27 20:29:43 2006] [error] [client] Premature end of script headers: selectPdb.pl
[Mon Nov 27 20:29:50 2006] [error] [client ] Premature end of script headers: selectPdb.pl
[Mon Nov 27 20:29:50 2006] [error] [client ] Can't locate Exporter/Heavy.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/lib/perl5/5.8.0/Exporter.pm line 17.
[Mon Nov 27 20:29:50 2006] [error] [client] BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/DBI.pm line 250.
[Mon Nov 27 20:29:50 2006] [error] [client ] Compilation failed in require at /home/httpd/cgi-bin/mysql_kalai/selectPdb.pl line 9.
[Mon Nov 27 20:29:50 2006] [error] [client] BEGIN failed--compilation aborted at /home/httpd/cgi-bin/mysql_kalai/selectPdb.pl line 9.

still i dont know what is the problem here.but the program works fine in terminal

here with i send a progam..
please help

#!/usr/bin/perl -w
print "content-type:text/html\n\n";
print "<html>";
print "<head>";
print "<body>";
use CGI;
$cgi=new CGI;
#BEGIN { $ENV{DBI_PUREPERL} = 1 }
use DBI;
#::PurePerl;
$pdb=$cgi->param('pdb');
$dbh=DBI->connect('dbi:mysql:mysql','kalai','kavithai') or die "connection failed : $DBI::errstr";
$pdb="1une";
$query="select * from pdbsummary where pdbid='$pdb'";
$exe=$dbh->prepare($query);
$exe->execute();
while(@array=$exe->fetchrow_array())
{
print @array;
}
$exe->finish;
$dbh->disconnect;
print "</body>";
print "</html>";
Nov 27 '06 #1
4 2024
GunnarH
83
I suspect that you have more than one version of Perl installed, and that /usr/bin/perl is not the same version as the one that's used when you run the script from command line. I'd reconsider the path at the shebang line.
Nov 27 '06 #2
hai,

i searched in my system we are installing only one version of perl that is in /usr/bin/perl

in the same program if i use the use DBI::PurePerl;
it is not show any thing and also it is not display anything.
the PUREPerl is the without compilation.

can you plz help me

thank you
Nov 27 '06 #3
GunnarH
83
Hmm.. If only to convince me, could you run this script both from command line and as CGI, and compare the results:
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. print "Content-type: text/plain\n\n";
  3. print "Perl version: $]\n\n";
  4. print "INC:\n", join("\n", @INC), "\n";
Nov 27 '06 #4
hai

i run the program in terminal

IN TERMINAL
-------------------
Perl version: 5.008

INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.

IN WEBBROWSER
________________

Perl version: 5.008

INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.


here also the same version so can you tell me any solution for this.
thank you
Nov 28 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Randell D. | last post by:
Folks, I feel like pulling my hair out - I tried unsuccessfully over the past few days to install ImagMagick but because of version conflicts and missing libraries I had to give up. I originally...
0
by: gary artim | last post by:
Hi All, I have a problem using DBIx::RecordSet. I get correct results but continue to get these messages on stderr. I looked at Compat.pm and it seems to be pointing out a problem with my call...
2
by: Daniel Tonks | last post by:
Here's the situation: I have a Perl-based forum that I wrote myself. It currently supports user accounts, but these are stored in a flat text file (as is everything else for that matter). I'm...
0
by: John Ntow | last post by:
I have a binary distribution of MySQL 4.0.20 installed in /usr/local/mysql. Therefore, the only libmysqlclient file I have is libmysqlclient.a (static library). And also, Perl:DBI already...
1
by: Alex Hunsley | last post by:
I am trying to install the DBD::mysql perl module. However, it claims I need mysql.h: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /home/alex/.cpan/Metadata Database was...
3
by: John D. Sanders | last post by:
I have just upgraded MySQL from version 3.23 to version 4.1.8 and now I am getting the following error when I try to run a script that worked: install_driver(mysql) failed: Can't load...
1
by: Angus Comber | last post by:
I have set a password for the mysql root user so when I do this: shell> perl -MCPAN -e shell cpan> install DBI cpan> install DBD::mysql install DBD::mysql fails Is there a way I can run...
13
by: James | last post by:
Hello, I'm a newbie to Python & wondering someone can help me with this... I have this code: -------------------------- #! /usr/bin/python import sys
1
by: Akino877 | last post by:
Hello, I have a simple Perl program that connects to MySQL and creates a table of first names and last names. The code is as follows : #!/usr/bin/perl -w use DBI; use Mysql; use DBD::mysql;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.