Quote:
Originally posted by bhomass I keep getting Premature end of script headers. the binary runs fine from command line, with all the necessary headers returned.
|
Your headers should be something like:
Code:
Content-Type: text/html
<blank line>
Your actual content...
Obviously "<blank line>" above is not literal, it means there's actually a blank line in that space.
If your script runs from the command line, but fails when run from the webserver, the first thing I'd look at is the environment. The environment from your command line may allow the script to run, but the (different, and more limited) environment when invoked by the webserver may not. An executing script that produces nothing on it's output will result in that "Premature end of script headers" error. Ditto for a core dumping script, ... etc. You could also try running your script as a cron job under the same userid that runs the webserver, and trap it's stdout and stderr to a file to see what might be going on. Cron will give you a limited environment, just as running under the webserver will.