Dunno if it helps, but I had this problem and pulled my hair out,
but I noticed I had was trying to "print" someting on the page on which I later used
header("Location: $HTTP_REFERER");
I got a parse error until I removed the "print" directive,
It was happy after that