Home > Backend Development > PHP Tutorial > Detailed explanation of PHP CLI mode

Detailed explanation of PHP CLI mode

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:13:56
Original
1521 people have browsed it

* php cli mode
* cli: Command Line Interface (command line interface)
* In addition to being called by Apache IIS server, PHP can also be run in cli mode, because php is essentially a program written in C language
* The following is Commonly used php cli commands

* Enter in the console:

php -v displays the PHP version

PHP CLI 模式详解

--ini outputs the information of the php.ini configuration file

PHP CLI 模式详解

--rf function < ;name> Output php function information, including function parameters

PHP CLI 模式详解

--ri Output php extension information

PHP CLI 模式详解

-i Output php detailed information, a lot of content, equivalent to phpinfo( );

-m Output the compiled module

PHP CLI 模式详解

--re Output the information of the PHP extension module, package the functions corresponding to this module, and the constants defined in this extension

PHP CLI 模式详解

Run in cli mode PHP program

Create a new cli.php file

Enter the first line:

#!C:phpphp.exe -q

This command indicates that this is a cli program

Then enter the php tag

Echo "Hello php cli";

? & gt;

Then enter php.exe cli.php

PHP CLI 模式详解 full program in the command line mode. _SERVER['argc'] and $_SERVER['argc'] to pass parameters

The parameters passed are daiyutage 22

#!C:\php\php.exe -q
 Note: When the 

ApachePHP CLI 模式详解 server passes the data submitted by the web page to the server to the php interpreter , which are passed through environment variables. Some PHP default

global variables

are PHP

global variables

set by the system after the PHP process is started and initialized after running the environment. All PHP can be used directly.

The above has introduced a detailed explanation of the PHP CLI mode, including Apache and global variables. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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