The windows packages between PHP 4.2.0 and PHP 4.2.3 distributed
the CLI as php-cli.exe, living in the same folder as the CGI
php.exe. Starting with PHP 4.3.0 the windows package distributes
the CLI as php.exe in a separate folder named cli, so cli/php.exe.
Starting with PHP 5, the CLI is distributed in the main folder,
named php.exe. The CGI version is distributed as php-cgi.exe.
As of PHP 5, a new php-win.exe file is distributed. This
is equal to the CLI version, except that php-win doesn't
output anything and thus provides no console (no "dos
box" appears on the screen). This behavior is similar
to php-gtk. You should configure with --enable-cli-win32.
What SAPI do I have?: From a shell, typing php -v will tell
you whether php is CGI or CLI. See also the function php_sapi_name()
and the constant PHP_SAPI.
Note: A Unix manual page was added in PHP 4.3.2. You may
view this by typing man php in your shell environment.
Remarkable differences of the CLI SAPI compared to other
SAPIs:
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 and --no-header switches are kept for compatibility so
that you can use older CGI scripts.
It does not change the working directory to that of the
script. (-C and --no-chdir switches kept for compatibility)
Plain text error messages (no HTML formatting).
There are certain php.ini directives which are overridden
by the CLI SAPI because they do not make sense in shell
environments: