title: Cannot modify header information after Wordpress migration
body: <p>I realise this has been asked many times, and the answer is usually some whitespace before or after the PHP tags however I have checked all my files and not found any evidence of this.</p>
  
  <p>I am using Wordpress and have debug mode switched on. My site works on one domain however I recently moved it to a new server (still running apache on linux - I did move from shared to a VPS) and gave it a new domain. All I have changed is the following in <code>wp-config.php</code>:</p>
  
  <pre><code>define('DB_NAME', 'new db name');
  define('DB_USER', 'new db user');
  define('DB_PASSWORD', 'new db password');
  define('WP_HOME','new url');
  define('WP_SITEURL','new url');
  </code></pre>
  
  <p>However I am now unable to log in, I have narrowed this down to the fact cookies are not being set. If I visit <code>wp-login.php</code> I get the following errors:</p>
  
  <pre><code>Warning: Cannot modify header information - headers already sent by (output started at /home/rcnhca/public_html/wp-includes/load.php:270) in /home/rcnhca/public_html/wp-login.php on line 368
  
  Warning: Cannot modify header information - headers already sent by (output started at /home/rcnhca/public_html/wp-includes/load.php:270) in /home/rcnhca/public_html/wp-login.php on line 380
  </code></pre>
  
  <p><strong>Note:</strong> Both <code>wp-login.php</code> and <code>load.php</code> are core Wordpress files.</p>
  
  <p>line 368 of <code>wp-login.php</code> is:</p>
  
  <pre><code>header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
  </code></pre>
  
  <p>and line 380:</p>
  
  <pre><code>setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
  </code></pre>
  
  <p>line 270 of <code>load.php</code> is:</p>
  
  <pre><code>ini_set( 'display_errors', 1 );
  </code></pre>
  
  <p>However I also recieve the following warning:</p>
  
  <pre><code>Warning: ini_set() has been disabled for security reasons in /home/rcnhca/public_html/wp-includes/load.php on line 270
  </code></pre>
  
  <p>Which I believe is because I have the Suhosin PHP patch installed but I am not definite on this. I do not want to run a more vulnerable version of PHP.</p>
  
  <p>I can't work out why this error is occurring, there is no trailing whitespace in any of my theme's PHP files.</p>
  
  <p><strong>Note:</strong> I also realise I can use output buffering to solve this, however I want to understand where the problem is occurring instead of applying a one-size fits all patch which will affect my debugging capabilities.</p>