Connecting Tech Pros Worldwide Help | Site Map

PostgreSQL connection in CGI-PERL Script

Newbie
 
Join Date: Feb 2008
Posts: 1
#1: Feb 6 '08
Hi,

I am trying to develop user interface in CGI-PERL using CGI.pm module with DBI.pm module.

while a form value is submitted to cgi program it is showing follwoing error
"Couldn't connect to db1:5432/tcp: IO::Socket::INET: Permission denied at /usr/lib/perl5/site_perl/5.8.8/DBD/PgPP.pm line 124"

Code is below

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use CGI qw/:standard/;
  4. use CGI qw/param/;
  5. CGI->nosticky();
  6. use CGI::Carp qw/warningsToBrowser fatalsToBrowser/;
  7. use DBI;
  8.  
  9. my $dbh=DBI->connect("DBI:PgPP:dbname=vidb05;host=db1;port=5432","vidb","",{AutoCommit=>0}) or die $DBI::errstr;
  10.  
can you please suggest me the actual problem with this code.

Thanks,
Ram Vinay Pandey
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#2: Feb 19 '08

re: PostgreSQL connection in CGI-PERL Script


Please check here for the connection strings.
Reply