Forum Moderators: phranque
About half of all page requests result in http headers being displayed just above the small SSI text files I insert into pages near top.
without any problems this setup of php-SSI was working for the past 3 or so years using include() php-function!
apparently unseen since for already a few days - may be since the last PHP security upgrade days ago - this new problem of header display occurred.
any idea WHY headers are displayed ?
NOT each time - but may be 50% of page loads
and
after a RE-load of a page usually the headers disappear and the page is shown clean
here the headers displayed - just ABOVE the SSI text:
HTTP/1.1 200 OK Date: Fri, 23 Oct 2009 18:18:04 GMT Server: God is Love Last-Modified: Wed, 28 Feb 2007 01:26:55 GMT ETag: "a7bde-22e-42a7f451415c0" Accept-Ranges: bytes Content-Length: 558 Connection: close Content-Type: text/html; charset=utf-8 X-Pad: avoid browser bug
any help welcome
If so, it may be a problem with the location, relative to the start of the page, of the <includes>. Almost always, the included code should follow either the <head> tag or the <body> tag. If it doesn't then the included file must start with a <DOCTYPE> and load the <html> and <head> and possibly provide all of the <head> section and <body> declaration as well.
In fact, the problem may be that you are already doing this. but that the included script(s) fail, and therefore the page is invalid and fails to render properly. In that case, you should take a look at the error log files on your server.
Alternatively, perhaps the script is outputting two newlines in a row while intended to only output and/or modify HTTP response headers. In that case, the two newlines will terminate the HTTP header, and any subsequent output will be treated as the content-body, so the browser will try to render it.
Short summary:
Those three things should give you a good idea where to look.
Jim
as said earlier - there was no error in my logs
and all worked for years the very same way - until the recent php5 security update. there was no change in script nor in php.ini or apache config.
however i googled and searched and tested and finally after more than a day of brainstorming, I found a new way to use same SSI modules without creating errors.
it MAY be that the new ( security updated ) php5 version has a more strict handling of include() with path or URL even if properly configured in php.ini.