Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache output 500 error: Premature end of script headers:

Status
Not open for further replies.

refugee13

Programmer
Dec 28, 2004
6
US
I have the below script, which I only included up until where the error message that I'm actually getting is. I recently moved this script to a new host, the CGIs were working on the old. I've tried everything I could think of and look up, including uploading all CGIs in ASCII, CHMOD to 755 all associated files, etc. Can someone please look and see if maybe some of my paths are incorrect maybe? When trying to load the script I get the 500 error and printed:
"Please, make sure that the files exist and/or access rights and paths are configured correctly." which is the error output at the bottom of code below, and Apache outputs:
Premature end of script headers: /home/bidorwin/public_html/cgi-bin/auction/auction.cgi

Thanks in advance!!
Code:
#!/usr/bin/perl
use vars qw(%config %category %form %supercat);
use vars qw/%cookie $loginalias $loginpassword/;
local %form = &get_form_data;
use strict;
require "/home/bidorwin/public_html/cgi-bin/auction/aboutme.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/abuse.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/adcreator.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/adcreator2.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/admin.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/adv-search.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/askseller.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/autorelist.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/buyit.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/cancerstik.lib";
require "/home/bidorwin/public_html/cgi-bin/auction/categories.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/changereg.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/closetoday.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/contactuser.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/daddons.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/dispcat.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/dispitem.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/displist.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/dutch.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/featured.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/feedback.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/gallery.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/goinggone.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/hotitems.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/invoice.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/invoicerequest.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/mailto.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/mybids.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/mysell.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/new.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/newtoday.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/procbid.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/procnew.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/procreg.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/reg.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/repost.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/search.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/selleredit.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/suggestcat.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/timeleft.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/viewall.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/viewclosed.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/viewbidderresults.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/viewresults.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/viewsellerresults.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/viewseller.cgi";
require "/home/bidorwin/public_html/cgi-bin/auction/watching.cgi";
local %config;
$config{'htmlpages'} = '[URL unfurl="true"]http://www.bidorwin.com';[/URL]
$config{'email'} = 'email.dat';
$config{'basepath'} = '/home/bidorwin/public_html/cgi-bin/auction/';
$config{'closedir'} = 'closed';
$config{'regdir'} = 'reg';
$config{'watchpath'} = 'watching';
$config{'tempemaildir'} = 'tempemaildir';
$config{'pagedir'} = 'user_page';
$config{'newestmember'} = 'newestmember';
$config{'count'} = 'count';
$config{'feeddir'} = 'feedback';
$config{'feedbreak'} = 25;
$config{'linkemail'} = 1;
$config{'emailfeed'} = 1;
$config{'adminpass'} = '402637';
$config{'mailprog'} = '/usr/sbin/sendmail -t';
$config{'admin_address'} = 'bidorwin@bidorwin.com';
$config{'scripturl'} = '[URL unfurl="true"]http://www.bidorwin.com';[/URL]
$config{'colortablehead'} = '#E6E6E6';
$config{'colortablehead0'} = '#E6E6E6';
$config{'colortablehead1'} = '#E6E6E6';
$config{'colortablehead2'} = '#E6E6E6';
$config{'colortablehead3'} = '#E6E6E6';
$config{'colortablehead4'} = '#E6E6E6';
$config{'colortablehead5'} = '#E6E6E6';
$config{'colortablehead6'} = '#E6E6E6';
$config{'colortablehead7'} = '#E6E6E6';
$config{'colortablehead8'} = '#E6E6E6';
$config{'colortablehead9'} = '#E6E6E6';
$config{'colortablehead10'} = '#EEEEEE';
$config{'colortablehead10T'} = '#E6E6E6';
$config{'colortablehead10B'} = '#EEEEEE';
$config{'colortablehead11'} = '#E6E6E6';
$config{'colortablehead12'} = '#E6E6E6';
$config{'colortablehead13A'} = '#FFFFBF';
$config{'colortablehead13B'} = '#FFFFBF';
$config{'colortablehead13C'} = '#FFFF8C';
$config{'colortablehead13D'} = '#FFFF8C';
$config{'colortablehead13E'} = '#FFFF00';
$config{'colortablehead13F'} = '#FFFF00';
$config{'specialtext0'} = '#FF0000';
$config{'specialtext1'} = '#FF0000';
$config{'specialtext2'} = '#FF0000';
$config{'text'} = '#000000';
$config{'text0'} = '#000000';
$config{'text1'} = '#000000';
$config{'text2'} = '#000000';
$config{'text3'} = '#000000';
$config{'text4'} = '#000000';
$config{'text5'} = '#000000';
$config{'text6'} = '#000000';
$config{'text7'} = '#000000';
$config{'text8'} = '#000000';
$config{'text9'} = '#000000';
$config{'text10'} = '#FF0000';
$config{'text10T'} = '#000000';
$config{'text10B'} = '#000000';
$config{'text12'} = '#000000';
$config{'text13A'} = '#000000';
$config{'text13C'} = '#000000';
$config{'text13E'} = '#000000';
$config{'colortablebody'} = '#E6E6E6';
$config{'colortablebody1'} = '#EFEFEF';
$config{'bordercolor'} = '#0000FF';
$config{'bordercolor1'} = '#000000';
$config{'odd_row_color'} = '#FFFFFF';
$config{'even_row_color'} = '#EEEEEE';
$config{'sitename'} = 'BidOrWin.com';
$config{'sitename2'} = 'MyStuff';
$config{'currency'} = '$';
$config{'currency2'} = 'U.S.';
$config{'currency3'} = 'dollar';
$config{'currency4'} = 'DOLLARS';
$config{'timezone'} = 'CT';
$config{'time'} = time;
$config{'time2'} = 0;
$config{'listingfee1'} = '0.15';
$config{'listingfee2'} = '0.30';
$config{'listingfee3'} = '0.60';
$config{'listingfee4'} = '1.25';
$config{'feerate1'} = '0.15';
$config{'feerate2'} = '4.99';
$config{'feerate3'} = '5.00';
$config{'feerate4'} = '14.99';
$config{'feerate5'} = '15.00';
$config{'feerate6'} = '29.99';
$config{'feerate7'} = '29.99';
$config{'boldfee'} = '-1.00';
$config{'textfeebold'} = '1.00';
$config{'bolditemnum'} = 'Yes';
$config{'highlightfee'} = '-1.00';
$config{'textfeehighlight'} = '1.00';
$config{'yellowrow'} = '#FFFF99';
$config{'grabberfee'} = '-1.00';
$config{'textfeegrabber'} = '1.00';
$config{'featitemnum'} = 'Yes';
$config{'featuredfee'} = '-12.95';
$config{'textfeefeaturedfee'} = '12.95';
$config{'catfeatitemnum'} = 'Yes';
$config{'catfeatfee'} = '-5.95';
$config{'textfeecatfeatfee'} = '5.95';
$config{'galleryfee'} = '-9.95';
$config{'textfeegalleryfee'} = '9.95';
$config{'max_days'} = '14';
$config{'hotnum'} = 10;
$config{'goinghours'} = 3;
$config{'newdays'} = 1;
$config{'i1'} = "[URL unfurl="true"]http://www.bidorwin.com/images/stargreen.gif";[/URL]
$config{'i2'} = "[URL unfurl="true"]http://www.bidorwin.com/images/starblue.gif";[/URL]
$config{'i3'} = "[URL unfurl="true"]http://www.bidorwin.com/images/staryellow.gif";[/URL]
$config{'i4'} = "[URL unfurl="true"]http://www.bidorwin.com/images/starred.gif";[/URL]
$config{'i5'} = "[URL unfurl="true"]http://www.bidorwin.com/images/starflying.gif";[/URL]
$config{'hot'} = '[URL unfurl="true"]http://www.bidorwin.com/images/hot.gif';[/URL]
$config{'new'} = '[URL unfurl="true"]http://www.bidorwin.com/images/new.gif';[/URL]
$config{'ending'} = '[URL unfurl="true"]http://www.bidorwin.com/images/ending.gif';[/URL]
$config{'pic'} = '[URL unfurl="true"]http://www.bidorwin.com/images/pic.gif';[/URL]
$config{'itemdesc'} = '[URL unfurl="true"]http://www.bidorwin.com/images/itemdesc.gif';[/URL]
$config{'feedback'} = '[URL unfurl="true"]http://www.bidorwin.com/images/feedback.gif';[/URL]
$config{'itembid'} = '[URL unfurl="true"]http://www.bidorwin.com/images/itembid.gif';[/URL]
$config{'add_desc'} = '[URL unfurl="true"]http://www.bidorwin.com/images/add-desc.gif';[/URL]
$config{'watchicon'} = '[URL unfurl="true"]http://www.bidorwin.com/images/watch.gif';[/URL]
$config{'buyiticon'} = '[URL unfurl="true"]http://www.bidorwin.com/images/buyiticon.gif';[/URL]
$config{'buyiticonsm'} = '[URL unfurl="true"]http://www.bidorwin.com/images/buyiticonsm.gif';[/URL]
$config{'aboutmeicon'} = '[URL unfurl="true"]http://www.bidorwin.com/images/aboutmeicon.gif';[/URL]
$config{'redarrow'} = '[URL unfurl="true"]http://www.bidorwin.com/images/redarrow.gif';[/URL]
$config{'newusericon'} = '[URL unfurl="true"]http://www.bidorwin.com/images/shades.gif';[/URL]
$config{'grabber1'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/star.gif';[/URL]
$config{'grabber2'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/disk.gif';[/URL]
$config{'grabber3'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/heart.gif';[/URL]
$config{'grabber4'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/bulb.gif';[/URL]
$config{'grabber5'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/atom.gif';[/URL]
$config{'grabber6'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/dollar.gif';[/URL]
$config{'grabber7'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/jewel.gif';[/URL]
$config{'grabber8'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/cube.gif';[/URL]
$config{'grabber9'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/diamond.gif';[/URL]
$config{'grabber10'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/football.gif';[/URL]
$config{'grabber11'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/traffic.gif';[/URL]
$config{'grabber12'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/time.gif';[/URL]
$config{'grabber13'} = '[URL unfurl="true"]http://www.bidorwin.com/images/grabbers/leftarrow.gif';[/URL]
$config{'grabbertitle1'} = 'Spinning Star';
$config{'grabbertitle2'} = 'Spinning Disk';
$config{'grabbertitle3'} = 'Throbbing Heart';
$config{'grabbertitle4'} = 'Light Bulb';
$config{'grabbertitle5'} = 'Spinning Atom';
$config{'grabbertitle6'} = 'Spinning Dollar';
$config{'grabbertitle7'} = 'Flashing Jewel';
$config{'grabbertitle8'} = 'Spinning Cube';
$config{'grabbertitle9'} = 'Spinning Diamond';
$config{'grabbertitle10'} = 'Football';
$config{'grabbertitle11'} = 'Traffic Light';
$config{'grabbertitle12'} = 'Time is Ticking';
$config{'grabbertitle13'} = 'Left Arrow';
$config{'nodutch'} = 'No';
$config{'godutch'} = 'Yes';
$config{'closedays'} = '30';
$config{'closedays2'} = '90';
$config{'numberofdays'} = '30';
$config{'newuser'} = '30';
$config{'convert'} = '/usr/bin/convert';
$config{'colortableimage'} = '#FFFFFF';
$config{'colortableheadtwo'} = '#FFFFFF';
$config{'allowupload'} = 1;
$config{'uploadcharge'}	= '-0.50';
$config{'textuploadcharge'}	= '0.50';
$config{'imageuploaddir'} = '/home/bidorwin/public_html/images/uploaddir';
$config{'imageuploadurl'} = "[URL unfurl="true"]http://www.bidorwin.com/images/uploaddir";[/URL]
$config{'thumbnailuploadurl'} = "[URL unfurl="true"]http://www.bidorwin.com/images/uploaddir/thumbs";[/URL]
$config{'thumbnailuploaddir'} = '/home/bidorwin/public_html/images/uploaddir';
$config{'thumbnailuploaddir2'} = '/home/bidorwin/public_html/images/uploaddir/thumbs';
$config{'thumbnail_size'} = 75;
    eval {
        if ($ENV{'WINDIR'}) {
            ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Windows
        }
        else {
            ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # UNIX
        }
        require "/home/bidorwin/cgi-bin/auction/uploadform.cgi";
    };
    if ($@) {
        print "Error - the following files couldn't be opened: $@\n";
        print "Please, make sure that the files exist and/or access rights and paths are configured correctly.";
        exit;
    }
 
You need to output headers in Apache, other webservers can be more forgiving, but this forgiveness allows for greater faux pas down the line if not addressed

Code:
CODE
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
the two newlines are important.

The error is exactly as Apache says - prem end of script headers- it's expecting a header, and none is forthcoming. Your error statement is printing, prior to you header

HTH
Happy new Year
--Paul



cigless ...
 
Paul, you're awesome!!

I had the Content-type further down, which may have worked on the old server, but didn't on this one....once I moved it to the top, works beautifully!

Thank you so much :)

Wishing I was cgiless...(sorry for the pun)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top