Andy Hassall <an**@andyh.co. uk> wrote:
} On Wed, 27 Apr 2005 14:34:30 -0400, Bernard Cosell <be****@rev.net > wrote:
}
} >I've been through the docs and I'm more than a little confused: I'd
} >like to run [some] PHP apps as ordinary CGI programs. I though/hoped
} >there'd be a command line switch [that I could put in my shebang line]
} >that'd tell PHP to run in SERVER mode, but I couldn't find it... Is
} >there a way to do that?
}
} What is "SERVER mode"?
I'm sure I'm getting the terminology wrong: I have a PHP program that when
run *by* Apache works fine, but when I run it directly [either from the
command line or have Apache run it as a CGI program, it won't produce the
HTTP headers. Even with explicit "header" calls in the program, it won't
make a legal HTML/HTTP web page [OTOH, if I put in an explicit "print
"Content-type...etc" it works fine].
There is something afoot that I don't understand about getting PHP to
output the HTTP headers [even when called as a CGI]...
} >[meta question: is there a way to get Apache to use mod_php on a
} >shebang'ed PHP program... that'd be best, of course..:o)]
}
} Don't think so - it'll output the shebang as literal text.
That doesn't seem to be happening for me:
$ cat test.php
#!/usr/bin/php
<html>
<body>
hello
</body>
</html>
$ php test.php
<html>
<body>
hello
</body>
</html>
No 'headers' and such [which is making it REAL hard to debug this PHP/CGI
program I'm working on], but also no shebang line!
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
be****@fantasyf arm.com Pearisburg, VA
--> Too many people, too few sheep <--