471,319 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

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)

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

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

Similar topics

2 posts views Thread by Ajay | last post: by
5 posts views Thread by hoozdiss | last post: by
1 post views Thread by Christoph Burschka | last post: by
reply views Thread by phpCodeHead | last post: by
3 posts views Thread by shybe | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.