Home > Backend Development > PHP Problem > How to install php cli mode

How to install php cli mode

藏色散人
Release: 2023-03-05 07:22:02
Original
3262 people have browsed it

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.

How to install php 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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template