I encountered a strange problem when I tried out my theme on the actual server. At first I thought it was a problem with the search function as the search URL is wrong (it still is). But that error happened in the admin interface too.
I tried commenting out the only header() call I added in, which is in the header.php file and redirects the WordPress search function, but that didn’t make a difference too.
Finally, I took a really close look at the error message and noticed that it was complaining about line 21 in functions.php. The file only had 20 lines! Turns out that all I had to do was to remove the extra newline after the closing ?> tag.