Click to See Complete Forum and Search --> : Premature end of script headers


seminole103
06-06-2000, 08:18 PM
Hi all,

I'm trying to configure my Red Hat 6.1 box to serve web pages with perl scripts using Apache (1.3.9), perl 5.005_03 and mod_perl (1.21).

I have a very simple "Hello World!" perl script that runs fine from command line, but whenever I try to run it through a web browser I get:

Internal Server Error

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

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the
error.

More information about this error may be available in the server error log.

This is what the error_log says:
[Tue Jun 6 18:50:39 2000] [error] [client xxx.xxx.xxx.xxx] Premature end of script
headers: /home/<username>/public_html/cgi-bin/hello2.pl

Does anyone know why this would happen and more importantly how to fix it? I looked on the apache and perl web sites. They discuss this being an issue when running earlier versions of Apache with earlier versions of mod_perl/perl.

Any help would be greaty appreciated!!

Thanks,
Phil

Golden_Eternity
06-10-2000, 03:11 AM
This isn't going to be terribly helpful, I'm afraid (I have no perl skills), but apache is up to 1.3.12... you could try upgrading.

Sokertes
01-24-2001, 02:07 AM
I know this is really late since this was first posted in june of 2000 and it is now january 2001 but I thought in case somebody else in the future might benefit from this. I was having the same problem after my server crashed hard (crashed and burned is more like it). After reinstalling and loading the backup of all the webfile content. None of my cgi scripts would work in my users cgi-bin's. At apache.org I read about the suexec. If you see it show up in your log files (/var/log/messages (for RH6.1 -6.2)). find the path to suexec and either rename it or remove it. I suggest renaming it to be on the safe side. After I renamed it..... bingo my users cgi-bin cgi scripts worked.

hope it helps

Sokertes

[This message has been edited by Sokertes (edited 24 January 2001).]

Ryeker
01-24-2001, 03:45 AM
Make sure PERL is installed... http://www.linuxnewbie.org/ubb/smile.gif I learned that one the hard way. Or, make sure that your PERL script knows where PERL is.

------------------
ryeker@yahoo.com

Energon
01-24-2001, 03:26 PM
uhh... no... the problem is that he's not transmitting the http header... you can't just print "Hello World" right off, you have to send the header first or else you get the "no content" error... I forget what the header is, but just about any working cgi perl script will have it in it...

Ryeker
01-24-2001, 04:11 PM
uh.... i don't know what you are talking about, but I received the same message from Apache, and the fix was installing PERL.

------------------
ryeker@yahoo.com

Beauty is only skin deep... Attitude runs to the bone. -Dark Angel