Sunday, February 19, 2012

Cannot modify header information - headers already sent error

This error ususally comes when we are working with session,cookies,redirects. If you are getting this error then try to follow the below steps to resolve:
  • Session should be started at the begining of the script and it should be written at the very first line.
  • There should not be any white spaces before session_start();
  • If you are using any MVC framework then make sure there are no whitespaces in controller files after the class is closed (after the close php tag " ?> " tag).

No comments:

Post a Comment