httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Turner <kk...@sbcglobal.net>
Subject Re: [users@httpd] Premature end of script headers
Date Sun, 26 Jan 2003 09:02:21 GMT
Will Williams wrote:

>Hi Jurgen,
>
>Yes my CGI executables have the #!/usr/bin/... line and they also have the
>"content-type..."  here is an example of my CGI for smokeping:
>Smokeping.cgi)
>******************
>#!/usr/local/bin/speedy -w

What language is "speedy"?  If this is Perl, the orthodox hash-bang is
#!/usr/bin/perl -wT

># -*-perl-*-
>
>use lib qw(/usr/local/smokeping/lib);
>
>use Smokeping 1.16;
>
>Smokeping::cgi("/usr/local/etc/smokeping/config");
>
>
>BEGIN {
>    if ($ENV{SERVER_SOFTWARE}) {
>        $SIG{__WARN__} = sub { print "Content-Type:
>text/plain\n\n".(shift)."\n"; };
>        $SIG{__DIE__} = sub { print "Content-Type:
>text/plain\n\n".(shift)."\n"; exit 1 }
>    };
>}
>***************

I won't try too evaluate the program, other than to say I would use a
different style :)

>I use VI, Pico or KDE editor to edit my files, never have used a MS
>windows editor.  Anxious to here your ideas on how to fix.

What does the reference to MS windows editor mean?  Will this run on a
legacy OS?  In that case, the hash-bang must reference the Windows path
eg. c:/some/path/perl.exe

>
>
>Will Williams
>williamsw@willwilliams.homeunix.net
>+49-178-806-7966
>
>On Sun, 26 Jan 2003, Jurgen wrote:
>
>> Hi,
>>
>> Do you have something like
>>   #!/usr/bin/perl
>> on top of the executable file and there is really a perl executable existing?
>> Do they have a line like
>>   print "Content-type:text/html\n\n";
>> before any other output starts?
>> Do you edit the files on windows with any editor?

Oops!  Ignore my ref to Windows.
>>
>> Jurgen
>>
>>
>> On Sun, 26 Jan 2003 07:59:24 +0100 (CET)
>> Will Williams <williamsw@willwilliams.homeunix.net> wrote:
>>
>> >
>> > I have read what the FAQ has to say about subject...but really could use
>> > some more help.  It seems none of my installed ports that require CGI work
>> > (smokeping or Nagios), they all error out with the above subject listed in
>> > the httpd-error-log.
>> >
>> > Can someone point me in the right direction?

Basically, you have a bug in the Perl script.  It does not necessarily
refer to the content line.
--
gt          kk5st@sbcglobal.net
Everything here could be wrong--Messiah's Handbook
as quoted by Bach in "Illusions"

---------------------------------------------------------------------
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