Can't serve with php. Displayes broken image. No errors, file exists
<p>Right now I'm working with <a href="http://fatcow.com" rel="nofollow">fatcow</a> hosting. I have application that should serve different kinds of files. Now I'll be asking on example of image png files.</p>

<p>This worked on my localhost wamp server with x-sendfile installed:</p>

<pre><code>header('Content-type:image/png');
header('Content-Length: ' . filesize($x_file));
header('X-Sendfile: '.$x_file);
exit;
</code></pre>

<p>Without x-sendfile it worked:</p>

<pre><code>header('Content-type:image/png');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
</code></pre>

<p>This worked as well (WideImage lib):</p>

<pre><code>require_once(DOC_ROOT."/includes/wideimage/WideImage.php");
$show = WideImage::load($file)-&gt;output('png');
exit;
</code></pre>

<p>On this server none of these approaches work.</p>

<ol>
<li>File exists</li>
<li>File size value is cought</li>
<li><p>No errors are displaied or logged:</p>

<p><code>ini_set('log_errors', 'On');
ini_set('error_log', DOC_ROOT.DS.'error.log');</code></p></li>
<li><p>Broken image graphic is shown in browser</p></li>
<li>If downloaded and opened in txt editor non-readable characters are given, but if opened with image viewer then broken file is shown</li>
</ol>

<p>My question is if there is anything I can think of or do to take a step forward into making my code do a work.</p>
