Me too ;-(
We've only previously used standalone php from the command line for general purpose scripting, which works fine with -q to turn off the headers.
But now we are actually trying to use it as a cgi. What I find utterly inexplicable is why the 2 line script:
#!/usr/bin/php
hello world
produces different output from the command line as compared with running as a cgi:
Command line execution:
X-Powered-By: PHP/4.0.4pl1
Content-type: text/html
hello world
Cgi execution:
#!/usr/bin/php hello world
The cgi executable is behaving differently depending on who loaded it? In particular, when loaded from the command line it strips out the #! line but not when loaded by Apache? I'm not sure which behaviour is reasonable, because php (unlike perl, bash, etc) does not recognise the # as a comment character (outside of <?..?> tags).
On balance, I'd say the cgi behaviour is "correct" but hey, what do I do about it messing up my web page!!!!
TIA
John Sutton