php cli mode installation method: first install apache and php; then execute the command "make install-cli" to install and turn on the CLI mode.
Recommended: "PHP Video Tutorial"
PHP installation turns on CLI mode
Starting from php version 4.3.0, PHP provides a new type of CLI SAPI (Server Application Programming Interface, server application programming port) support, named CLI, which means Command Line Interface, that is, command line interface . As the name suggests, this CLI SAPI module is primarily used as a development shell application for PHP. CLI SAPI has many differences from other CLI SAPI modules, which we will elaborate on in this chapter. It's worth mentioning that CLI and CGI are different SAPIs, although they share a lot of common behavior.
If apache and php have been installed, switch to the php installation package directory where compilation started.
Execute: make install-cli
If apache and php have not been installed yet, then Just add: --enable-cli
View version:
# cd sapi/cli [root@localhost cli]# ./php -v PHP 7.0.0-dev (cli) (built: Mar 28 2015 00:54:11) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
Since --enable-cli and --enable-cgi are both valid by default at the same time, there is no need to Add --enable-cli to the configuration line to cause the CLI to be copied to {PREFIX}/bin/php during the make install process.
The above is the detailed content of How to install php cli mode. For more information, please follow other related articles on the PHP Chinese website!