The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Using PHP header() function crashes Apache

I am using Apache and PHP under XP Pro and, for some reason, whenever a script uses the header() function it causes the Apache service to crash. Has anyone else come across this problem, because I've tried re-installing, using different versions of PHP and Apache and I still get this problem over and over.

This only happens on my Dell Dimension - I've used the same combination on half a dozen other machines without any problems.
Paul Brown Send private email
Tuesday, August 22, 2006
So a really simple page like this:


header('Content-type: text-html');


Will crash PHP?  Or is just within your application that it happens?

PHP 5.1.5 was just released, try that one. 

Are you using some kind of custom build as PHP 5.1.x isn't supported directly on Apache 2.2.x?  The binary package from only supports the Apache 2.0.x on Windows.
Almost H. Anonymous Send private email
Tuesday, August 22, 2006
Make sure the header() call appears before anything else on the page, as in the example above. Trying to call header after echoing or printing text will cause problems since the header will already have been sent. (though of course it still shouldn't crash...

Tuesday, August 22, 2006
Mystery solved; somehow the registry had got corrupted and, as a result, the Apache service was being started twice on the same machine listening on the same ports etc. Apparantley this doesn't cause any conflicts until one of the Apache services tries to send a http header which, presumably, gets intercepted by the other. Oh, well, fixed now.
Paul Brown Send private email
Friday, August 25, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz