From my understanding you can have code before header() is called. You just can't output anything to the browser before it is called. This would include your included file as well.
Another option (which I'm sure someone will say is bad practice) is to call obstart() right before your call to header(). This will force error messages into a buffer instead of displaying them in the browser.