Search code examples
sslhttpsrackspace-cloudhttp-1.1

HTTPS page returning HTML source and header rather than content?


I'm building a web app with PHP and Python (The site has SSL) and once in a very long while, randomly, the page returns the header message followed by the HTML source, rather than showing the page's content.

This happens sometimes once out of every 30 times I load the page, or other times once out of 500 or so times.

It's very random, too.

Other times it renders just fine.

Here's what the header looks like:

HTTP/1.1 200 OKServer: Apache/2.2
Content-Type: text/html; charset=UTF-8
Date: Wed, 22 Feb 2012 10:40:33 GMT
Transfer-Encoding: chunked
Connection: Keep-Alive

66c2

The 66c2 changes randomly


Solution

  • Either Apache is not recognizing the .php extension and isn't running the code through the PHP module (in which case you would see your PHP code in the browser) or else the content-type has something wrong with it and thus the browser will punt and just display it as text instead of rendering it. The only other thing I can think of off the top of my head is that PHP is sometimes not closing the response properly.