By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

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

P: n/a
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)

Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
>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
Do your test scripts generate legitimate headers for your
output? (e.g.:

Content-type: text/html

is a minimal header set)
PHP runs fine from the command line, incidentally


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
Jul 16 '05 #2

P: n/a

"Gordon Burditt" <go***********@sneaky.lerctr.org> wrote in message
news:bi********@library1.airnews.net...
Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions onapache manual and php manual (as far as I can see), but getting "internal
server error" in browser... log says "Premature end of script headers" formy simple test scripts


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

Content-type: text/html

is a minimal header set)


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!
Jul 16 '05 #3

P: n/a
"Seagull Manager" <se*************@nospamthanksbecauseisayso.demon.c o.uk> wrote in message news:<bi*******************@news.demon.co.uk>...
"Gordon Burditt" <go***********@sneaky.lerctr.org> wrote in message
news:bi********@library1.airnews.net...
Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions onapache manual and php manual (as far as I can see), but getting "internal
server error" in browser... log says "Premature end of script headers" formy simple test scripts


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

Content-type: text/html

is a minimal header set)


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!


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
Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.