PHP: better header

pretty much streamline #75 with no conflicts, to fix gzip issue and send the error code