Home  >  Article  >  Backend Development  >  Summary of common commands under the php command line

Summary of common commands under the php command line

藏色散人
藏色散人forward
2019-10-26 14:13:522777browse

Summary of common commands under the php command line

1. php -m

Display the modules compiled into the kernel

Summary of common commands under the php command line

2. php -v

Display php version number

Summary of common commands under the php command line

3. php --ini

Display configuration file name

Summary of common commands under the php command line

4. php -h

Display which command line commands are available

Summary of common commands under the php command line

##5. php --info

View class/function/extension information, just like using phpinfo() on the web server

6. php --rf

Display information about the function

7. php --rc

Display information about the class

8. php --re

Display information about the extension

9. php --ri

Display the configuration information of the extension

10. php --rz

Display name information about zend extension

11. About the development of command line scripts

(1) $argv is an array containing The provided parameters, the first parameter is the name of the file

(2)$argc is the number of parameters

eg:

We have an index.php This script

<?php
echo &#39;命令行参数个数: &#39; . $argc . "n";
echo "命令行参数:n";
foreach ($argv as $index => $arg) {
echo " {$index} : {$arg}\n";
}

We run php index.php from the command line 1 2 3

The output results are as follows:

Summary of common commands under the php command line

The above is the detailed content of Summary of common commands under the php command line. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete