kevin has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use DBI; use CGI qw(:standard); use CGI::Carp "fatalsToBrowser"; my $dbh = DBI->connect("dbi:mysql:database=dbname;host=localhost", "uname", "pword") or die "Unable to connect to DB: $DBI::errstr"; $dbh->disconnect(); print header, start_html(-title=>'Title', -BGCOLOR=>'blue', -text=>'white'), p('test'), end_html;
My web hosting service uses Perl 5.8.4 and MySQL 5.0.18.
Running this script via Firefox yields a blank white page; clicking "View Source" bring up a completely blank window. In IE, I get a "Cannot find server/this page cannot be displayed" error. Nothing shows up in the error log. If I remove the "dbh->connect" line, the page functions properly.
Even if I've mucked up the connection string somehow, shouldn't any error be posted to the browser via fatalsToBrowser? I am getting no feedback on what might be going wrong, and I am stumped.
Help!
Kevin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dbh connections: stumped!
by jfroebe (Parson) on Mar 11, 2006 at 16:54 UTC | |
|
Re: dbh connections: stumped!
by graff (Chancellor) on Mar 11, 2006 at 17:08 UTC | |
by kevin (Initiate) on Mar 11, 2006 at 20:08 UTC | |
by wfsp (Abbot) on Mar 12, 2006 at 07:47 UTC | |
by graff (Chancellor) on Mar 13, 2006 at 02:29 UTC | |
|
Re: dbh connections: stumped!
by jeanluca (Deacon) on Mar 11, 2006 at 16:41 UTC | |
|
Re: dbh connections: stumped!
by thor (Priest) on Mar 11, 2006 at 16:28 UTC | |
|
Re: dbh connections: stumped!
by wfsp (Abbot) on Mar 11, 2006 at 16:55 UTC |