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

Summary of common commands under the php command line

藏色散人
Release: 2023-04-07 18:00:01
forward
2812 people have browsed it

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";
}
Copy after login

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!

Related labels:
php
source:segmentfault.com
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