* 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
--ini outputs the information of the php.ini configuration file
--rf function < ;name> Output php function information, including function parameters
--ri
-i Output php detailed information, a lot of content, equivalent to phpinfo( );
-m Output the compiled module
--re Output the information of the PHP extension module, package the functions corresponding to this module, and the constants defined in this extension
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
PHP
Echo "Hello php cli";
? & gt;
Then enter php.exe cli.php
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 theApache 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 variablesare PHP
global variablesset 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.