www.uburst.com www.uburst.com

""Premature end of script headers" Message"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

General uDirectory Troubleshooting
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
""Premature end of script headers" Message"
Posted by Moderator on Sep-27-99 at 06:23 PM (EST)
I bought the Deluxe uDirectory and try to install it but get error when excecute it as http://www.my_directoy/udirectory.pl. I look at the server's error.log and it says "Premature end of script headers: /cgi-bin/udirectory.pl" Do you have any idea what is going on? I double check all the variables and they look correct. I also double the permission on both cgi and listing directories. I also try to rename the script to udirectory.cgi but no help. I know my cgi-bin directory work because I have a form handler script in there too and it works. My server is Linux base running Apache.
Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

Premature end of script headers, Moderator, Sep-27-99, (1)
"premature end of script heade..., Jona Decker, Nov-30-01, (2)
premature end of..., Jona Decker, Nov-30-01, (3)
RE: premature end of..., Joseph Pishgar, Dec-03-01, (4)
RE: premature end of..., Bill Weiner, Dec-04-01, (5)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "Premature end of script headers"
Posted by Moderator on Sep-27-99 at 06:26 PM (EST)
In regard to the problem you are seeing:

1) First, just to be sure (although this is probably not the problem), make sure that the script was transferred to your server in ASCII or TEXT mode (as opposed to BINARY or RAW mode). Transferring it in BINARY or RAW mode could cause that error....so be sure it was transferred in ASCII or TEXT mode.

2) What version of Perl are you using? We wrote uDirectory to be compatible (in theory) with both Perl 4 and Perl 5, however, we have seen that some people using Perl 5 (particularly Perl 5.00502) will get that "Premature end of script headers" (See the CASE DESCRIPTION below). So if you have an option to use Perl 4, then go with that.

Example:

As we often help people get the script setup on their server, we did ran across this once. The person gave us two paths to Perl on their server:

#!/usr/local/bin/perl5.00502
#!/usr/local/bin/perl

When using #!/usr/local/bin/perl5.00502 for the path to Perl (the first line of the script), we got the following error:

----------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@www59.hway.net and inform them of the time the error occurred, and
anything you might have done that may have caused the error.

There was also some additional information available about the error:
[Sun Jan 24 07:38:41 1999] access to /u/web/bestb7/cgi-local/udirectory.pl failed for
208.14.41.52, reason: Premature end of script headers
----------

Then when we changed the path to #!/usr/local/bin/perl, and everything worked fine.

I'm not exactly sure what type of server they were using (since we just FTPed to the server/account that they gave us), but changing that path (I'm guessing to an older version of Perl) worked. Again, we have only ran into this once and the uDirectory CGI script should have worked with Perl 5.00502 - but I don't know why we got the error.

In anycase, double-check the path to perl that you are using.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . ""premature end of script headers" part deux"
Posted by Jona Decker on Nov-30-01 at 04:37 PM (EST)
I am having a similar problem...testing uDirectory Personal before buying uDirectory Business.

I'm able to login, and to access the "Add" screen. However, when I try to add a user, I get the ubiquitous Internal Server Error with "premature end of script headers" as the error, which isn't very helpful.

I've run it from the command line, which *was* a little more helpful. The error message I get there is:

perl udirectory.cgi
parse error in file udirectory.cgi at line 707, next 2 tokens "create_main_form("
Execution of udirectory.cgi aborted due to compilation errors.

Line 707 is:

create_main_form("The listing " . $original_lastname . ", " . $original_firstname . " was not found.");

(Apologies for any browser wrap that may occur. It's all one line in the script as written)

I've seen this error before in relationship to Perl versions, but going *up* has always helped, not hurt. I've used the path to both perl4 and perl5 on my system, and both generate this error.

Any ideas?

TIA

Jona

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "premature end of..."
Posted by Jona Decker on Nov-30-01 at 06:35 PM (EST)
I disabled taint in perl 5 and the script is working. (Current host requires running scripts with taint checking...but that will be a non-issue soon). However, I still see the token errors when I run perl from the command line, and being the retentive sort, don't like it. What can I do to make the script "legal" and what kind of server impacts result from running it the way it is?

Jona

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
4 . "RE: premature end of..."
Posted by Joseph Pishgar on Dec-03-01 at 02:06 PM (EST)
Hello Jona,

Taint should definitely be disabled when running uDirectory. Additionally, any other perl path modifiers should be turned off (removed from the first magical line of the script) before uploading and CHMODing the script if possible. Recheck the path to perl, and paths to the listings directory are correct (and chmoded 777).

Try that, and see if the errors continue to persist.

Regards,
Joseph Pishgar
Microburst Technologies, Inc.
www.uburst.com

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
5 . "RE: premature end of..."
Posted by Bill Weiner on Dec-04-01 at 07:48 AM (EST)
Actually, "taint" should not be causing a problem with the CGI script.

Looking at your original error message:

parse error in file udirectory.cgi at line 707, next 2 tokens "create_main_form("......

Line 707 in the script does call the "create_main_form" subroutine... however, it appears that line is missing an ampersand ( & ) in front of the function name. That is, in Perl, most function calls "should" have an ampersand directly before the function name. I say "should" because it is not really required... however, maybe having "taint" enabled does cause the ampersand to be required. (Note that all our other calls to "create_main_form" do have an ampersand in front of it.... it's just missing on the call in line 707 for some reason.)

Anyway, in short, try modifying line 707 in the udirectory_personal script such that the ampersand is before the "create_main_form" call:

STEP 1: Make a backup of your current udirectory_personal.pl script... just in case.

STEP 2: Open your "udirectory_personal.pl" script with any text editor such as WordPad.

STEP 3: Locate line 707 in the script, which starts with the following:

create_main_form("The listing

STEP 4: Add an ampersand in front of that line, like this:

&create_main_form("The listing

STEP 5: Save the file.... as TEXT if your editor asks... and try it out!

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.