Home  >  Article  >  Backend Development  >  PHP execution program php.exe parameter analysis

PHP execution program php.exe parameter analysis

小云云
小云云Original
2018-03-31 14:34:042853browse

-f : Run the specified PHP file in command line mode. As long as you specify the specific PHP file (with absolute path), php.exe can execute the PHP file, so it does not matter if this parameter is used alone. It doesn't matter, it is somewhat similar to displaying the results of PHP execution in browser mode. The difference is that since it is run in command line mode, it is output in the form of HTML source code. If there is an error in the execution, the error message will also be listed.

Usage

c:\php\php -f

or

c:\php\php

-F : Corresponds to the php.exe parameter -f. This parameter means that the PHP file will be executed in command line mode every time a line is entered. Reasonable use of argn and
## in the PHP file The two variables #argi can do a lot of things with this parameter, such as executing different program codes based on the user's keyboard input, which is very interesting.

Knowledge point: argn represents the content of the line currently entered in the PHP command line, and

argi represents the line number. For a single line, you can understand how many times it is entered.

-i: This command line parameter will call the phpinfo() function and display the results. If you execute this parameter as php-cgi.exe, the difference between php.exe and php-cgi.exe is that when php-cgi executes this command parameter, the input is in HTML format, while php.exe is expressed in variable form, which is concise Much clearer.

Usage

c:\php\php -i

-l: Perform syntax check on the specified PHP code. In fact, this command line parameter is useless. It is fatal The error cannot be detected, which is why I did not use this parameter of php.exe when configuring the syntax checking tool of Editplus. Note: This parameter cannot be used with -f.

Usage

c:\php\php -l

-m: This command line parameter is mainly used to output built-in and loaded PHP and Zend module

Usage

c:\php\php -m

-v: This command line parameter is mainly used to output the version information of PHP and Zend

Usage

c:\php\php -v

–ini: This command line parameter is mainly used to output the location information of the PHP configuration file

Usage

c:\php\php -r "code"

–ini: This command line parameter is mainly used to output the location information of the PHP configuration file

Usage method

c:\php\php --ini

At this point, the basic usage and common parameters of the PHP command line execution program php.exe have been introduced.

We know the PHP program The running mode is usually run on the web page, but in fact, the PHP script program can be run independently through the PHP command line.

Reasonable use of php.exe can achieve many functions, such as the plan we have always been obsessed with Task,

can completely execute the corresponding PHP program on the Windows platform by calling the PHP command line program php.exe in batch mode.

Related recommendations:

php.exe program directly requests the url

##What is the use of php.exe

Questions about php.exe

The above is the detailed content of PHP execution program php.exe parameter analysis. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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