gpt4 book ai didi

php - 了解管道 : PHP -c

转载 作者:行者123 更新时间:2023-12-03 23:07:02 24 4
gpt4 key购买 nike

我无法理解这个 Linux 命令:
php -r "readfile('https://getcomposer.org/installer');" | php -c php.ini

出现第一部分php -r正在管道至 php -c 。但看起来php.ini正在阅读

我在哪里可以找到有关 php 命令选项及其含义(-v 和 -c)的更多信息,从而了解该命令正在做什么?

最佳答案

来自 man php :

OPTIONS --interactive -a Run PHP interactively. This lets you enter snippets of PHP code that directly get executed. When readline sup‐ port is enabled you can edit the lines and also have history support.

  --bindpath address:port|port
-b address:port|port
Bind Path for external FASTCGI Server mode (CGI only).

--no-chdir
-C Do not chdir to the script's directory (CGI only).

--no-header
-q Quiet-mode. Suppress HTTP header output (CGI only).

--timing count
-T count Measure execution time of script repeated count times
(CGI only).

--php-ini path|file
-c path|file Look for php.ini file in the directory path or use the
specified file

--no-php-ini
-n No php.ini file will be used

--define foo[=bar]
-d foo[=bar] Define INI entry foo with value bar

-e Generate extended information for debugger/profiler

--file file
-f file Parse and execute file

--help
-h This help

--hide-args
-H Hide script name (file) and parameters (args...) from
external tools. For example you may want to use this
when a php script is started as a daemon and the command
line contains sensitive data such as passwords.

--info
-i PHP information and configuration

--syntax-check
-l Syntax check only (lint)

--modules
-m Show compiled in modules

--run code
-r code Run PHP code without using script tags '<?..?>'

--process-begin code
-B begin_code Run PHP begin_code before processing input lines

--process-code code
-R code Run PHP code for every input line

--process-file file
-F file Parse and execute file for every input line

--process-end code
-E end_code Run PHP end_code after processing all input lines

--syntax-highlight
-s Output HTML syntax highlighted source

--server addr:port
-S addr:port Start built-in web server on the given local address and
port

--docroot docroot
-t docroot Specify the document root to be used by the built-in web
server

--version
-v Version number

--strip
-w Output source with stripped comments and whitespace

--zend-extension file
-z file Load Zend extension file

args... Arguments passed to script. Use '--' args when first
argument starts with '-' or script is read from stdin

--rfunction name
--rf name Shows information about function name

--rclass name
--rc name Shows information about class name

--rextension name
--re name Shows information about extension name

--rzendextension
name
--rz name Shows information about Zend extension name

--rextinfo name
--ri name Shows configuration for extension name

--ini Show configuration file names

来自 php.net:

Usage: php [options] [-f] [--] [args...] php [options] -r [--] [args...] php [options] [-B ] -R <code> [-E
] [--] [args...] php [options] [-B ] -F
[-E ] [--] [args...] php [options] -- [args...]<br/>
php [options] -a</code>

<code>

<p>-a Run interactively -c | Look for
php.ini file in this directory -n No php.ini file will
be used -d foo[=bar] Define INI entry foo with value 'bar' -e
Generate extended information for debugger/profiler -f <br/>
Parse and execute . -h This help -i<br/>
PHP information -l Syntax check only (lint) -m<br/>
Show compiled in modules -r Run PHP without
using script tags -B Run PHP
before processing input lines -R Run PHP for
every input line -F Parse and execute for every
input line -E Run PHP after processing all
input lines -H Hide any passed arguments from external
tools. -S : Run with built-in web server. -t
Specify document root for built-in web server. -s<br/>
Output HTML syntax highlighted source. -v Version
number -w Output source with stripped comments and
whitespace. -z Load Zend extension .</p>

<p>args... Arguments passed to script. Use -- args when first
argument
starts with - or script is read from stdin</p>

<p>--ini Show configuration file names</p>

<p>--rf Show information about function . --rc
Show information about class . --re <br/>
Show information about extension . --rz Show
information about Zend extension . --ri Show
configuration for extension .</p>
</code>
<code>

<p><strong>Edit:</strong></p>

</code><pre><code>php -r "readfile('https://getcomposer.org/installer');" | php -c php.ini
</code></pre>

<p>This command runs the file <a href="https://getcomposer.org/installer" rel="noreferrer noopener nofollow">https://getcomposer.org/installer</a> using php.ini in the current directory as the config file. The same can be achieved with</p>

php -r "require('https://getcomposer.org/installer');" -c php.ini

关于php - 了解管道 : PHP -c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36491134/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com