scott.marlowe wrote:
Ahhh. OK. Yeah, when I first started writing stuff in it and figured out
the cgi version worked fine as a scripting language I was so happy. Due
to its http heritage, you have to run it with a -q switch to tell it to
not add headers to its output.
It can even do asyn stream handling, but I haven't played with that much.
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
This is off topic but...
Newer versions (4.3.*) of PHP compile a command line (php-cli) instance.
You no longer have to do two compiles when building the apache module.
Some features of which (from
http://www.php.net/manual/en/features.commandline.php):
Unlike the CGI SAPI, no headers are written to the output.
Though the CGI SAPI provides a way to suppress HTTP headers, there's no equivalent switch to enable them in the CLI SAPI.
CLI is started up in quiet mode by default, though the -q switch is kept for compatibility so that you can use older CGI scripts.
It does not change the working directory to that of the script. (-C switch kept for compatibility)
Plain text error messages (no HTML formatting).
There are certain php.ini directives which are overriden by the CLI SAPI because they do not make sense in shell environments
- ...
And yes the stream handling is very nice and will be even better when 5.0.0 hits the release stage, not to mention the class implementation improvements.