Debugging in Drupal isn't always the easiest job in the world. PHP's error reporting is not always very clear and when something goes wrong behind your Drupal screens, you might not necessarily be pointed to the exact location of the error.

This is the fact for those wonderful "Headers already sent" errors that sometimes appear all the way at the top of your page.

When that happens, you know that some bit of code, somewhere in your drupal directory has outputted something before Drupal was fully ready to do so.

Luckily enough, you know that when errors appear in Drupal, you often know you're probably not the first and probably not the last who has had your particular problem. And more than often is such is the case, people have posted a solution online.

In the case of the "Headers already sent" issue, this is no different. 

Drupal.org has a handy page online, explaining a bit more about the error, so you at least know where to start looking.

In my case, I learned that if your "Headers already sent" messages come AFTER other error messages, you'll probably solve your headers problem by solving those other erros first. Chances are the other error is the cause of your headers issue.

In my case this was a "PHP Notice:  unserialize() ..." error. Somewhere behind the screens drupal is trying to unserialize one of its variables and is encountering some issues with that.

Unless you want to go through all of your variables in the variable table in your database (which I guess you won't), there's an interesting strategy for finding our exactly which variables your Drupal install is having trouble unserializing.

Again, that handy strategy has been written down for you on this page on the Drupal.org site.

Two pages every Drupaleer should bookmark. Just in case.