httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <di...@webweaving.org>
Subject RE: Premature end of script headers???
Date Tue, 20 Aug 2002 19:20:29 GMT

Somehow your script outputs something *before* it gets to these print
statements. Just put on the first two lines of the script

	$|=1;print "Content-type: text/plain\r\n\r\n";

to find out -what- is being printed. Or move the print's below up to the
top.

Dw.

On Wed, 21 Aug 2002, [big5] Chan Raymond wrote:

> Sorry...I am a idiot.....
>
> I don't know what u are talkin' about. Can you explain
> it to me in detail.
>
> What is http header actually....
>
> I have found ....
>
> print "Content-type: text/html\n";
> print "Pragma:no-cache\n\n";
>
> {
>  local ($oldbar) = $|;
>  $cfh = select (STDOUT);
>  $| = 1;
>  #
>  # print your HTTP headers here
>  #
>  $| = $oldbar;
>  select ($cfh);
> }
> .....
> in the guestbook.cgi.
> What is it means?
>
> Can anyone also tell me howto test the .cgi file in
> command line.
>
> Thank you very much and Best Regards
> Raymond
>
>  --- Dirk-Willem van Gulik <dirkx@webweaving.org>
> 的郵件內容:>
> >
> > On Tue, 20 Aug 2002, Nelson, Robert D. wrote:
> >
> > > The error you describe happens when the script
> > attempts to output via CGI
> > > but sends it without header information to tell
> > the server what to do with
> > > it.  The most common reason for this is when the
> > programmer forgets to add
> > > a...
> > >
> > >   print "Content-type: text/html\n\n";
> > >
> > > ...line to the top of HTML output.
> > >
> > > Either way, this is a programming problem, not an
> > Apache problem.
> >
> > Or somehow some other output manages to be send out
> > before the above. what
> > can help during troubleshooting is to put
> >
> > 	 $|=1;
> > 	 print "Content-type: text/plain\n\n";
> >
> > as the very first two lines of your perl script.
> > This may help you debug
> > what is actually written by your script. A common
> > culprit is an unexpected
> > error which writes something before the script has
> > written its proper
> > content-type string.
> >
> > Dw
> >
> >
> >
> ---------------------------------------------------------------------
> > 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@httpd.apache.org
> >    "   from the digest:
> > users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail:
> > users-help@httpd.apache.org
> >
>
> _________________________________________________________
> 曬數碼相每張只係 $1.2!
> Print your digital photos for $1.2 each only
> http://photos.yahoo.com.hk
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message