RE: [users@httpd] Premature end of script headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Tom Cat [mailto:strycat@xxxxxxxxx] 
> Sent: Dienstag, 21. Februar 2006 15:25
> To: users@xxxxxxxxxxxxxxxx
> Subject: Re: [users@httpd] Premature end of script headers
> 
> On 2/21/06, Matt Weston <MWeston@xxxxxxx> wrote:
> > Try changing it to hello.pl
> >
> 
> Thanks.  Just tried that doesn't seem to care what what the file is
> name or what extension it has, it just keeps giving the Premature end
> of script headers error.
> 
> I also tried just now adding
> use CGI::Carp 'fatalsToBrowser';
> print "Content-Type: text/html\n\n";
> and I still get the error.

Where? 

Be precise when posting code snippets, the position of the print statement is critical.

To clear up some of the confusing advice you've been getting:

- the extension is not important, .cgi is fine.
- you don't need the CGI:Carp module (don't complicate life unnecessarily)
- your problem is simply that you script does not output a content-type header. Did you read the doc I referred you to?

If you carefully reproduce the three lines in the program in the docs, it will work. If you still have problems, run the script from the command line and post the output, ie:

$ cd /var/www/cgi-bin/
$ ./hello.cgi

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> Doesn't seem to matter what's in the file either.
> 
> I discovered this problem as I was trying to install MoveableType (so
> I really need it to work without me having to rename everything to .pl
> or add extra lines of code).
> 
> So now what?
> 
> Thanks.
> >
> >
> > >>> strycat@xxxxxxxxx 2/21/2006 8:12:17 AM >>>
> > All of my perl scripts generate this error when I try to have Apache
> > serve them.  I'm on RHEL with Apache 2.0.52.
> >
> > The simplest script I have is:
> > #!/usr/bin/perl
> > print "Hello";
> >
> > In the error log I'm told:
> > [Tue Feb 21 08:57:48 2006] [error] [client 10.33.1.32] Premature end
> > of script headers: hello.cgi
> >
> > I've tried changing LogLevel from warn to debug and still 
> only get this message.
> >
> > In httpd.conf, I load cgi_module (mod_cgi.so) at the 
> beginning as well
> > as suexec_module (mod_suexec.so).
> >
> > I also set the following:
> > ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
> > <Directory "/var/www/cgi-bin">
> >     AllowOverride None
> >     # Options None
> >     Options ExecCGI
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> >
> > in /var/www, when I do ls -lh I get
> > drwxr-xr-x  2 root      root 4.0K Feb 21 08:53 cgi-bin
> >
> > in /var/www/cgi-bin, when I do ls -l I get
> > -rwxr-xr-x  1 apache apache 32 Feb 20 16:01 hello.cgi
> >
> > I have tried changing the owner and group of hello.cgi It 
> was at first
> > both root and I changed it to apache (which is what httpd runs as).
> >
> > I've tried changing the location of the cgi-bin directory.  
> I've tried
> > to change the name of the file to just hello (dropping the cgi
> > extension).  I've changed permissions on both the file and 
> the cgi-bin
> > directory (when I do that, it will sometimes complain in suexec.log
> > that something is writable by others).  I've tried not 
> loading suexec,
> > but that doesn't change the result.
> >
> > I don't know what to do at this point.  What should I try next?
> >
> > Thanks in advance,
> >
> > Tom
> >
> > 
> ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP 
> Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP 
> Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> >    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> >
> >
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This e-mail is of a private and personal nature. It is not related to the exchange or business activities of the SWX Group. Le présent e-mail est un message privé et personnel, sans rapport avec l'activité boursière du Groupe SWX.
 
 
This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux