Gossamer Forum
Home : Products : DBMan : Installation :

CGI ERROR Not Returning Complete Headers

Quote Reply
CGI ERROR Not Returning Complete Headers
I have been running this program on a win nt server with Omni Httd server (a shareware server) for over a year with no problems.
I need to make the database public, so I uploaded it to our webserver:

www.espcorp.com/dbman/db.cgi

I specified the path to perl and that was the only Mod I made.

I am getting the following error: CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:



Bareword found where operator expected at c:\webserver\espcorp.com\www\dbman\db.cgi line 50, near "unless ($db_setup =~ /^[A-Za-z0-9]+$/) { die "Invalid" (Do you need to predeclare unless?)String found where operator expected at c:\webserver\espcorp.com\www\dbman\db.cgi line 51, near "require "" (Might be a runaway multi-line "" string starting on line 50) (Missing semicolon on previous line?)Scalar found where operator expected at c:\webserver\espcorp.com\www\dbman\db.cgi line 51, near "require "$db_setup" (Do you need to predeclare require?)String found where operator expected at c:\webserver\espcorp.com\www\dbman\db.cgi line 52, near "require "" (Might be a runaway multi-line "" string starting on line 51) (Missing semicolon on previous line?)Bareword found where operator expecte


_____________________________
Below is the code around line 50
_____________________________

# If you run into problems, set $db_script_path to the full path
# to your directory.
$db_script_path = "c:\webserver\espcorp.com\www\dbman\";

# Load the form information and set the config file and userid.
local(%in) = &parse_form;
$in{'db'} ? ($db_setup = $in{'db'}) : ($db_setup = 'default');
$in{'uid'} ? ($db_uid = $in{'uid'}): ($db_uid = '');

# Required Librariers
# --------------------------------------------------------
# Make sure we are using perl 5.003, load the config file, and load the auth file.
eval {
unshift (@INC, $db_script_path);
require 5.003; # We need at least Perl 5.003
unless ($db_setup =~ /^[A-Za-z0-9]+$/) { die "Invalid config file name: $db_setup"};
require "$db_setup.cfg"; # Database Definition File
require "auth.pl"; # Authorization Routines
}

if ($@) { &cgierr ("Error loading required libraries.\nCheck that they exist, permissions are set correctly and that they compile.\nReason: $@"); }

# If we are using benchmarking, then we start a timer and stop it around &main. Then we print the difference.
if ($db_benchmark) { $t0 = new Benchmark; }

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.

# Stop the timer and print.
if ($db_benchmark) { $t1 = new Benchmark; print "<h6>Processing Time: " . timestr(timediff($t1, $t0)) . "</h6>"; }

# Display debugging information if requested.
&cgierr("Debug Information") if ($db_debug);

exit; # There are only two exit calls in the script, here and in in &cgierr.


I am also attaching the complete db.cgi file for review.

Can anyone see what is wrong. I have been working on this for hours with no resolve.


Thanks
Erick
Quote Reply
Re: [Erickroyer] CGI ERROR Not Returning Complete Headers In reply to
You said you moved it to:

www.espcorp.com/dbman/db.cgi

but in your db.cgi file you still have it setup as if it's run on your server?

Try changing this:

$db_script_path = "c:\webserver\espcorp.com\www\dbman\";

back to the original:

$db_script_path = "";

It's only on rare occasions that it is necessary to set this.

If you have debug setup to also catch errors in your .cfg file the problem could be in there. Do you have it defined as:

$db_dir_url = "http://www.espcorp.com/dbman/db.cgi ";

It works best to save your files a text files and provide the url where they can be viewed. I myself don't want to have to download a file to check it out.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] CGI ERROR Not Returning Complete Headers In reply to
>>back to the original:

$db_script_path = "";<<

The original is:

$db_script_path = ".";
Quote Reply
Re: [LoisC] CGI ERROR Not Returning Complete Headers In reply to
I did check the default.cfg file and I did have the URL incorrect. I also changed the db.cgi file back as you suggested. Now when I run the program I get this error:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:



syntax error at c:\webserver\espcorp.com\www\dbman\db.cgi line 58, near ") {"Execution of c:\webserver\espcorp.com\www\dbman\db.cgi aborted due to compilation errors. I put the file at www.espcorp.com/dbman/db.cgi.txt so that you can view it.I am not sure what the syntax error is. Originally it said the error was on line 55 so I commented those lines out and then it said the error is on line 58. I have a feeling that it will just keep moving down. ThanksErick
Quote Reply
Re: [Erickroyer] CGI ERROR Not Returning Complete Headers In reply to
I think your best bet would be to add a snippet of code called "Debugging - How To Obtain Useful Error Messages" found under troubleshooting in the FAQ noted below.

This may provide more specific error messages. Please note to catch errors in your .cfg file you should move

$db_debug = 0;

top above the section # File and URL's

Looking at the path it looks like you are still trying to run this locally? c:\webserver\espcorp.com\www\dbman\db.cgi

I wasn't able to open the file you linked to .. I got a 404 error. The problem just may be in your .cfg file.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] CGI ERROR Not Returning Complete Headers In reply to
I have debug off.

The program is on a winnt server at experthost.com.

The path that you are seeing in the error is the actual path on the server of the program.

The continued error that i am getting is: CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:



syntax error at c:\webserver\espcorp.com\www\dbman\db.cgi line 55, near ") {"Execution of c:\webserver\espcorp.com\www\dbman\db.cgi aborted due to compilation errors.
I am not sure why the links did not work, but here they are againwww.espcorp.com/dbman/db.cgi.txtwww.espcorp.com/dbman/default.cfg.txt I hope you can tell what is wrong, because I am stumpped. -Erick
Quote Reply
Re: [Erickroyer] CGI ERROR Not Returning Complete Headers In reply to
I'm not at all familiar with working with NT servers.
I'd suggest locating this thread:

Subject: DBMan in a Windows environment - Checklist
AstroBoy 12-Oct-00
Thread: http://gossamer-threads.com/p/108916

and also searching the forum for the specific error message as you are gettings, as there are several threads related to your problem. One I noticed it was necessary for them to change the file name to .pl instead of using .cgi.

I'm sure if you search the forum you will find your solution. Sorry I could not be of more help.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/