The difference you're seeing between environments is most almost certainly a difference in the configuration.
One of two things is happening on the server that isn't emiting Warnings:
1) Output buffering is on by default
2) error_reporting and/or display_errors is set so you're just not seeing the warnings. But if this were the case, your headers still wouldn't get set, so it's probably #1
You can check these settings by looking at the output from phpinfo()
Output buffering, when enabled, buffers any output (regular content not inside tags, anything you echo or print(), etc) on the server and then sends it to the client in one shot.
I'd poke around in your portable version, find php.ini, and try turning output buffering on. Alternatively, you can turn output buffering on at runtime by sticking ob_start()
near the top of your script.