title: Transfered Codeigniter project from Windows to Mac - Cannot modify header information - headers already sent by
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
  </blockquote>
  
  
  
  <p>I finally got my first Mac Book yesterday. I like it , but one problem is really screwing with me . For some reason my project I transferred from my windows laptop isnt working properly. XAMPP starts up , I go to localhost/CI_BUHZ  and the login page works as expected , I type in my credentials and hit enter, but then for some reason the whole thing gets stuck on my validate_credentials function in my login controller. it doesnt give me any errors , only 2 warnings - included below</p>
  
  <p>Id like to note that:
  *This project works perfect on my old windows laptop i transferred it from.
  *Mod Rewrite is on to the best of my knowledge- if my my other controllers method calls such as CI_PROJECT/Login and CI_PROJECT/Feeds/Home are working right?
  *Even if i delete the validate_credentials function and recreate it with only this:</p>
  
  <pre><code>function validate_credentials()
      {  
  
  
  
      redirect('site/home');
      }
  </code></pre>
  
  <p>it still will not go from login -> site/home on my mac. </p>
  
  <p>Here is the original validate credentials function :</p>
  
  <pre><code>function validate_credentials()
      {       
          $this-&gt;load-&gt;model('membership_model');
          $query = $this-&gt;membership_model-&gt;validate();
          if($query) // if the user's credentials validated...
          {
              $uid = $this-&gt;membership_model-&gt;grab_uid();
              $data = array(
                  'username' =&gt; $this-&gt;input-&gt;post('username'),
                  'uid' =&gt; $uid,
                  'is_logged_in' =&gt; true
          );
          $this-&gt;session-&gt;set_userdata($data);
          redirect('site/home');
          }
          else // incorrect username or password
          {
              $this-&gt;index();
          }
      }   
  </code></pre>
  
  <p>here is the .htaccess:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /CI_BUHZ/
  
      #Removes access to the system folder by users.
      #Additionally this will allow you to create a System.php controller,
      #previously this would not have been possible.
      #'system' can be replaced if you have renamed your system folder.
      RewriteCond %{REQUEST_URI} ^system.*
      RewriteRule ^(.*)$ /index.php?/$1 [L]
  
      #When your application folder isn't in the system folder
      #This snippet prevents user access to the application folder
      #Submitted by: Fabdrol
      #Rename 'application' to your applications folder name.
      RewriteCond %{REQUEST_URI} ^application.*
      RewriteRule ^(.*)$ /index.php?/$1 [L]
  
      #Checks to see if the user is attempting to access a valid file,
      #such as an image or css document, if this isn't true it sends the
      #request to index.php
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?/$1 [L]
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
      # If we don't have mod_rewrite installed, all 404's
      # can be sent to index.php, and everything works as normal.
      # Submitted by: ElliotHaughin
  
      ErrorDocument 404 /index.php
  &lt;/IfModule&gt; 
  </code></pre>
  
  <p><strong>Here's the img_model its complaining about ( even though the function being called doesn't require this model at all:</strong></p>
  
  <pre><code>&lt;?php
  
  class Image_model extends CI_Model {
  
  
  function get_images ($album_id, $uid){
      $album_id =(int)$album_id;
      $q = $this-&gt;db-&gt;query("SELECT image_id, album_id_fk, timestamp, ext, uid_fk FROM images WHERE album_id_fk = $album_id AND uid_fk = $uid");
          if($q-&gt;num_rows() &gt; 0) {
              foreach($q-&gt;result() as $row) {
                  $data[] = $row;
              }
  
              return $data;
          }
      }
  
  
  function image_check($image_id , $uid_fk){
  $image_id = (int)$image_id;
  $query = mysql_query("SELECT COUNT(image_id) FROM images WHERE image_id = $image_id AND $uid_fk");
  return (mysql_result($query, 0)==1) ? true : false;
  
  }
  
  function delete_image($uid_fk, $image_id){
  $image_id =(int)$image_id;
  
  $image_query = mysql_query("SELECT album_id_fk , ext , uid_fk FROM images WHERE image_id = $image_id AND uid_fk = $uid_fk");
  $image_result = mysql_fetch_assoc($image_query);
  $album_id = $image_result['album_id_fk'];
  $ext = $image_result['ext'];
  $uid = $image_result['uid_fk'];
  
  unlink('uploads/'.$uid.'_'.$album_id.'_'.$image_id.'.'.$ext);
  unlink('uploads/thumbs/'.$uid.'_'.$album_id.'_'.$image_id.'.'.$ext);
  
  mysql_query("DELETE FROM images WHERE image_id = $image_id AND uid_fk = $uid_fk");
  
  
  }
  }
  
  ?&gt;
  
  
  A PHP Error was encountered
  Severity: Warning
  Message: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/CI_BUHZ/application/models/image_model.php:2)
  Filename: libraries/Session.php
  Line Number: 672
  A PHP Error was encountered
  Severity: Warning
  Message: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/CI_BUHZ/application/models/image_model.php:2)
  Filename: helpers/url_helper.php
  Line Number: 546
  </code></pre>