Re: Another version of "incomplete headers (0 bytes) "
"James Donnelly" <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hey Christoph,
Many thanks for your reply.
I have tried a number of forms of header, including the one you provide. I
have tried sending a 200 message in the header too.
Regards,
James
> Hi,
>
> I am not familar with perl and your webserver but maybe its that the
> exact header should be "Content-Type: text/html\n\n"
>
> As your app is running as dynamic server it uses no port but a socket
> type connection to your fpm.
>
> if for instance your webserver does not recognize the header
> "Content-type" to be valid or gets confused with "\r\n" linebreaks it is
> clear that it has to issue a 500.
>
> usually it should be sufficient to do line breaking by \n and perl oder
> the language cares about what is your plattform default.
>
> regards,
> Christoph
>
> James Donnelly wrote:
> > Hi All,
> >
> > I have a problem getting any kind of sample FCGI script to work. I have
> > found lots of examples of the error message I'm getting, but none that
> > seem to match the circumstances I'm seeing.
> >
> > I've tried a few 'Hello World' type scripts, including one using
> > CGI::Fast from CGI.pm, but I'll use this one, from man FCGI, as an
example:
> >
> > ---
> > #!/usr/bin/perl
> > use FCGI;
> > my $count = 0;
> > my $request = FCGI::Request();
> >
> > while($request->Accept() >= 0) {
> > print("Content-type: text/html\r\n\r\n", ++$count);
> > }
> > ---
> > On requesting the script I get a 500, along with this report in the
> > error_log:
> >
> > ---
> > [warn] FastCGI: (dynamic) server "/usr/local/apache2/htdocs/test.fcgi"
> > started (pid 1033)
> > [error] [client ??.??.??.??] FastCGI: incomplete headers (0 bytes)
> > received from server "/usr/local/apache2/htdocs/test.fcgi"
> > ---
> >
> > Incidentally, the version using CGI::Fast give me:
> >
> > ---
> > Use of uninitialized value in ref-to-glob cast at
> > /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/FCGI.pm line 28
> > ---
> >
> > But I'm not worried about that for now. In my httpd.conf, I have:
> >
> > ---
> > AddHandler fastcgi-script fcg fcgi fpl
> > ---
> >
> > The ExecCGI option has been set for the folder containing the test
> > script. When Apache starts, it reports:
> >
> > ---
> > [notice] FastCGI: process manager initialized (pid 1023)
> > [notice] Apache/2.0.52 (Unix) mod_fastcgi/2.4.2 configured -- resuming
> > normal operations
> > ---
> >
> > After the script does its 500, I have a look at what's still running:
> >
> > ---
> > nobody 1023 0.0 0.7 5052 1852 ? S 17:08 0:00
> > /usr/local/apache2/bin/fcgi- -k start
> > nobody 1033 0.0 0.8 4556 2272 ? S 17:10 0:00
> > /usr/bin/perl /usr/local/apache2/htdocs/test.fcgi
> > ---
> > The script executes fine from within the shell, and in the browser as a
> > plain cgi. I have considered having a look at cgi-fcgi to test things
> > further, but having to resort to this would make the whole effort less
> > worthwhile.
> >
> > How do you find out what port the FCGI server is listening on to try a
> > telnet? I found this: "The application (fastcgi library) assumes the
> > listening port was put on file descriptor 0 when the process was
> > started", but I'm too ignorant to understand how that helps me.
> >
> > I have the following software versions:
> >
> > Fedora Core 1
> > Linux 2.4.22-1.2188
> > Apache 2.0.52
> > mod_fastcgi 2.4.2
> > FCGI 0.64
> > Perl 5.8.3
> >
> > Thanks for listening anyone who read this far! Any suggestions or
> > pointers would be most welcome.
> >
> > Best Regards,
> >
> > James
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ___________________________________
> > fastcgi-developers mailing list
> > http://fastcgi.com/fastcgi-developers/
>
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/