title: How to fix "Headers already sent" error in PHP
body: <p>When running my script, I am getting several errors like this:</p>
  
  <blockquote>
    <p>Warning: Cannot modify header information - headers already sent by (<strong>output started at /some/file.php:12</strong>) in <strong>/some/file.php</strong> on <strong>line 23</strong></p>
  </blockquote>
  
  <p>The lines mentioned in the error messages contain <a href="http://php.net/header" rel="noreferrer"><code>header()</code></a> and <a href="http://php.net/setcookie" rel="noreferrer"><code>setcookie()</code></a> calls.</p>
  
  <p>What could be the reason for this? And how to fix it?</p>