Drupal: “Headers already sent” error

When installing a new instance of drupal, I got the error “headers already sent.”
I also got this same error a few weeks earlier when installing “Gallery” (Gallery website)

In the case of Gallery, the issue was that I had created a new blank “config.php” page by control-clicking the gallery folder and selecting New File from the menu, forgetting that this creates a page with html headers. I didn’t notice, because I did not open the page to look at it – I simply uploaded it. Stripping out those headers solved the problem.

In the case of Drupal, it turned out it was a problem with the theme having some extra returns, although since I simply replaced it with a new copy, i was never sure exactly where the problem was. There are several forum messages that discuss this problem. In some cases it is a problem with magic quotes.

View thread 1
View thread 2
View thread 3