I'm seeing a very strange issue with script output. Iām sometimes getting a four digit hexadecimal code before the output begins, and a zero at the end of output - for example:
2fc3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
......
</html>
0
The hex number varies depending on requested uri and / or contents. I'm not using caching and output compression is off. I've seen this issue on a couple of projects, each very different and hosted on different servers.
An example of the issue can be seen here: http://www.holidayproperties.co.uk/notfound.html
You can substitute 'notfound' with any random text to see the hex code change to different values.
I use this template library - http://codeigniter.com/forums/viewthread/95687 - although even when bypassing the library and outputting directly, using echo, I see the same issue.
I'd love to be able to solve this issue, so all assistance is greatly appreciated.
[Edit] I've discovered that removing the following:
$this->output->set_header('HTTP/1.1 404 Not Found');
Fixes the issue, but why should this be happening in the first place? The header is being set before any output, and indeed I don't get any of the php / ci warnings about setting headers after output has begun.
Thanks,
Bryn.