Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Premature end of script headers: says error logs

Quote Reply
Premature end of script headers: says error logs
I tried to call up my admin.cgi at:

<A HREF="http://www.funny-sounds.com/links2/humor2/admin/admin.cgi" target="_new">http://www.funny-sounds.com/links2/humor2/admin/admin.cgi</A>

and it gives me a Internal Server Error message.
When I checked my raw server error_logs. It read:

"Premature end of script headers: /home3/funny-sounds/public_html/links2/humor2/admin/admin.cgi"

I believe that I have uploaded everything in ASCII because I told my cuteftp to send all files in ASCII mode, rather
than autodetect. All my directories and files are temporarily at 777... just so I can eliminate the possiblility of chmod errors.

If you would like to look at my files:

My directories are open for viewing (777) at the moment so you can see my files at the url below.

<A HREF="http://www.funny-sounds.com/links2/" target="_new">http://www.funny-sounds.com/links2/</A>

Where do you think the problem lies... I looked through the script for numorous hours before I decided to ask for help.

My server's path to perl is:
#!/usr/local/bin/perl
sendmail = /usr/lib/sendmail
root is: /home3/funny-sounds/
public html webspace is: /home3/funny-sounds/public_hmtl
cgibins can be created anywhere within the the
public_html webspace.

My environmental variable can be viewed at:
<A HREF="http://www.funny-sounds.com/cgibin/envhtml.cgi" target="_new">http://www.funny-sounds.com/cgibin/envhtml.cgi</A>

I hope that is enough info.
Please reply. Thanks.
Quote Reply
Re: Premature end of script headers: says error logs In reply to
Sorry...but you need to save your admin.cgi file as a text file for use to view it!

The problem is most likely related to NOT using the complete absolute path to the links.cfg file in the admin.cgi file.

Regards,

Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
Quote Reply
Re: Premature end of script headers: says error logs In reply to
Hello Eliot,

All the .cgi files has been renamed "_cgi.txt"
the links.cfg file has been renamed "links_cfg.txt" for easy viewing now.

I am pretty sure that I placed the correct absolute path to
links.cfg on all .cgi files. I have used
/home3/funny-sounds/public_html/......... for all my previous cgi installs and that works fine. Putting /opt2/
before that does not work.

I tried running nph-build.cgi from the command line via
telnet, and this is the result:


no2:/opt2/home3/funny-sounds/public_html/links2/humor2/admin>perl nph-build.cgi

Building Pages
Pages built on 18-May-2000 at 21:29:08
--------------------------------------------------------

Backing up database . . .
Backing up links, category and email database (File::Copy) ...
Done.

Building URL Index . . .
Done.

Updating New and Popular Records . . .
What's New Cutoff: 14 days
Popular Cutoff: 2 hits
Content-type: text/html

<PRE>

CGI ERROR
==========================================
Error Message : Error building! Links database is 0 bytes!
Script Location : nph-build.cgi
Perl Version : 5.00503

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
EDITOR : pico
HOME : /home3/funny-sounds
HOSTNAME : no2
HOSTTYPE : sparc
LOGNAME : funny
MACHTYPE : sparc-sun-solaris2.7
OLDPWD : /opt2/home3/funny-sounds/public_html/links2/humor2
OSTYPE : solaris2.7
PATH : /usr/bin:/usr/lib/nis/bin:/usr/local/bin:/usr/local/Hughes/bin:/bin:/usr/java/bin:/usr/local/pgsql/bin
PS1 : no2:\w>
PWD : /opt2/home3/funny-sounds/public_html/links2/humor2/admin
SHELL : /bin/bash
SHLVL : 1
SSH2_CLIENT : 43.197.151.243 2208 207.228.228.151 22
TERM : vt100
TZ : US/Eastern
UMASK : 022
USER : funny
_ : /usr/bin/perl

</PRE>no2:/opt2/home3/funny-sounds/public_html/links2/humor2/admin>

I get an "Error: Links database is Zero Bytes."

Please take a look at my open directory:

http://www.funny-sounds.com/links2/humor2/



Quote Reply
Re: Premature end of script headers: says error logs In reply to
Your server is probably not configured to execute Non Parsed Header files (nph) via your web browser. So, you need to apply the code hacks mentioned in the Cobalt Server and NPH Files FAQ in the Resource Center. This is most likely the cause of your error message.

Also, the error message with links.db being 0 bytes means that you have NO links in your links.db file...add links and categories before building your directory!

Regards,

Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
Quote Reply
Re: Premature end of script headers: says error logs In reply to
Can you post the direct url to the hack?
I searched the resouce section and can't find
the cobalt nph hack...

Quote Reply
Re: Premature end of script headers: says error logs In reply to
Well, it seems like gotze and Gossamer Threads have lost some data when they transferred over data from the old site. It seems like the Resource Center is missing about twenty FAQs since there were 34 FAQs in the old Resource Center.

Anyway....here it goes again...I would recommend bookmarking this or copy the following codes in a file and saving it...

1) Go into your nph-build.cgi file.

2) Delete $nph in the following codes:

Code:
use vars qw(Ętegory %subcategories @links @new_links @cool_links %stats $grand_total $use_html $nph $date $time);
3) Delete the following codes:

Code:
$nph++;
4) Change the following codes:

Code:
$use_html = 1;
to the following:

Code:
$use_html = 0;
It should work now....

Good luck!

Regards,

Eliot Lee
Anthro TECH, L.L.C
Web: http://www.anthrotech.com/
Quote Reply
Re: Premature end of script headers: says error logs In reply to
I tried to use the Nph hack you talked about. It doesn't seem to work. I'm wondering if someone has an older version of links2.0 that they downloaded a couple months ago. Because they might have changed something in there. About 6 months ago, I have gotten that one to work in the past on my server, but never used it since. On march, I accidentally deleted the old working one...and decided to install a new one. The newer install of 2.0 did not work. I figured that since i got it to work once in the past, that maybe something has changed that made it no longer work.