Apache, PHP, and WinXP, getting "Premature end of script headers" -- help?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Seagull Manager

    Apache, PHP, and WinXP, getting "Premature end of script headers" -- help?

    Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions on
    apache manual and php manual (as far as I can see), but getting "internal
    server error" in browser... log says "Premature end of script headers" for
    my simple test scripts

    PHP runs fine from the command line, incidentally

    I tried changing the doc_root in php.ini from blank to the path of htdocs --
    no difference.

    Any suggestions? Grateful for any advice.

    (ps, will be grateful if not sidelined into discussions as to why doing this
    on windows, thanks very kindly)



  • Gordon Burditt

    #2
    Re: Apache, PHP, and WinXP, getting "Premat ure end of script headers" -- help?

    >Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions on[color=blue]
    >apache manual and php manual (as far as I can see), but getting "internal
    >server error" in browser... log says "Premature end of script headers" for
    >my simple test scripts[/color]

    Do your test scripts generate legitimate headers for your
    output? (e.g.:

    Content-type: text/html

    is a minimal header set)
    [color=blue]
    >PHP runs fine from the command line, incidentally[/color]

    Frequent causes of no headers generated by a CGI (some of these
    apply to PHP as a module also, if that's even possible on WinXP) include:

    - The web server can't find the CGI or refuses to run it for some
    reason (check permissions, and with Apache, making permissions
    TOO LIBERAL can screw things up). Check the server error log.
    - The CGI fails to execute for some reason (can't find libraries,
    PATH not set as expected, permission problems) or aborts early.
    - The script forgets to output headers. This should be less of
    a problem with PHP, but there may still be an issue of error
    messages showing up ahead of the headers.
    - Error/warning messages output before the headers.

    Gordon L. Burditt

    Comment

    • Seagull Manager

      #3
      Re: Apache, PHP, and WinXP, getting "Premat ure end of script headers" -- help?


      "Gordon Burditt" <gordonb.2zpcc@ sneaky.lerctr.o rg> wrote in message
      news:bimgfj$v0c @library1.airne ws.net...[color=blue][color=green]
      > >Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions[/color][/color]
      on[color=blue][color=green]
      > >apache manual and php manual (as far as I can see), but getting "internal
      > >server error" in browser... log says "Premature end of script headers"[/color][/color]
      for[color=blue][color=green]
      > >my simple test scripts[/color]
      >
      > Do your test scripts generate legitimate headers for your
      > output? (e.g.:
      >
      > Content-type: text/html
      >
      > is a minimal header set)[/color]

      Hi, thanks very much for suggsestions. I tried a few tweaks here and there,
      but nothing worked. I was trying to use PHP as cgi because I thought it
      would be the most straightforward way to get it up and running (how wrong I
      was!) I've given up and followed the module route, and - guess what? - It
      took a few minutes, and it works just fine!


      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Apache, PHP, and WinXP, getting &quot;Premat ure end of script headers&quot; -- help?

        "Seagull Manager" <seagull.manage r@nospamthanksb ecauseisayso.de mon.co.uk> wrote in message news:<bin95g$e5 j$1$8302bc10@ne ws.demon.co.uk> ...[color=blue]
        > "Gordon Burditt" <gordonb.2zpcc@ sneaky.lerctr.o rg> wrote in message
        > news:bimgfj$v0c @library1.airne ws.net...[color=green][color=darkred]
        > > >Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions[/color][/color]
        > on[color=green][color=darkred]
        > > >apache manual and php manual (as far as I can see), but getting "internal
        > > >server error" in browser... log says "Premature end of script headers"[/color][/color]
        > for[color=green][color=darkred]
        > > >my simple test scripts[/color]
        > >
        > > Do your test scripts generate legitimate headers for your
        > > output? (e.g.:
        > >
        > > Content-type: text/html
        > >
        > > is a minimal header set)[/color]
        >
        > Hi, thanks very much for suggsestions. I tried a few tweaks here and there,
        > but nothing worked. I was trying to use PHP as cgi because I thought it
        > would be the most straightforward way to get it up and running (how wrong I
        > was!) I've given up and followed the module route, and - guess what? - It
        > took a few minutes, and it works just fine![/color]

        Yes, My fellow guys also faced same problem (PHP4.3.2
        (cgi)/Apache 1.3/XP). I don't know if it's a bug. For them,
        reinstalling Apache fixed the problem.

        ---
        "Believe it or not, patriotism is one of the worst dividing forces"
        Email: rrjanbiah-at-Y!com

        Comment

        Working...