title: PHP setcookie() gives "Cannot modify header information – headers already sent" warning
body: <p>I've seen this questions milions of times, but none of the solutions works for mine.</p>
  
  <p>This works on my pc, but not on a web-hosting. Is it something to do with the php.ini or httpd.conf ?</p>
  
  <pre><code>&lt;?php
  ob_start();
  setcookie("show","1",time() + 300);
  ?&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;UDO - Under Development Office&lt;/title&gt;
  
      &lt;body&gt;
          Hello World!
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <hr>
  
  <p>Later edit:</p>
  
  <pre><code>&lt;?php 
      var_dump(ob_get_contents());
  ?&gt;
  </code></pre>
  
  <p>Prints: <strong>bool(false)</strong></p>
  
  <p>AND</p>
  
  <pre><code>&lt;?php
      ob_start();
      var_dump(ob_get_contents());
  ?&gt;
  </code></pre>
  
  <p>Prints: <strong>string(0) ""</strong></p>
  
  <p>This is not a duplicate question since none of the questions asked before on Stackoverflow resolved this issue.</p>
  
  <p>I must insist that this works on my Mac OS X with PHP 5.3.6, but not on a shared host(same PHP version).</p>