mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
240 lines
9.3 KiB
HTML
240 lines
9.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>输出关于 PHP 配置的信息</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.phpinfo" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">phpinfo</h1>
|
||
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">phpinfo</span> — <span class="dc-title">输出关于 PHP 配置的信息</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.phpinfo-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>phpinfo</strong></span>
|
||
([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$what</code><span class="initializer"> = INFO_ALL</span></span>
|
||
] ) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
输出 PHP 当前状态的大量信息,包含了 PHP 编译选项、启用的扩展、PHP 版本、服务器信息和环境变量(如果编译为一个模块的话)、PHP环境变量、操作系统版本信息、path 变量、配置选项的本地值和主值、HTTP 头和PHP授权信息(License)。
|
||
</p>
|
||
<p class="para">
|
||
因为每个系统安装得有所不同,<span class="function"><strong>phpinfo()</strong></span> 常用于在系统上检查 <a href="configuration.html" class="link">配置设置</a>和
|
||
<a href="language.variables.predefined.html" class="link">预定义变量</a>。
|
||
</p>
|
||
<p class="para">
|
||
<span class="function"><strong>phpinfo()</strong></span> 同时是个很有价值的、包含所有 EGPCS(Environment, GET, POST, Cookie, Server) 数据的调试工具。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.phpinfo-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">what</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
可以用以下的一个或多个 <em class="emphasis">constants</em> 用位运算传递给可选的 <code class="parameter">what</code> 参数来定制输出的信息。
|
||
该参数可以把常量相加或者用 <a href="language.operators.bitwise.html" class="link">or</a> 操作符按位运算。
|
||
</p>
|
||
<p class="para">
|
||
<table class="doctable table">
|
||
<caption><strong><span class="function"><strong>phpinfo()</strong></span> 选项</strong></caption>
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>Name (constant)</th>
|
||
<th>Value</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
|
||
</thead>
|
||
|
||
<tbody class="tbody">
|
||
<tr>
|
||
<td>INFO_GENERAL</td>
|
||
<td>1</td>
|
||
<td>
|
||
配置的命令行、 <var class="filename">php.ini</var> 的文件位置、建立的时间、Web 服务器、系统及更多其他信息。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_CREDITS</td>
|
||
<td>2</td>
|
||
<td>
|
||
PHP 贡献者名单。参加 <span class="function"><a href="phpcredits.html" class="function">phpcredits()</a></span>。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_CONFIGURATION</td>
|
||
<td>4</td>
|
||
<td>
|
||
当前PHP指令的本地值和主值。参见 <span class="function"><a href="ini_get.html" class="function">ini_get()</a></span>。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_MODULES</td>
|
||
<td>8</td>
|
||
<td>
|
||
已加载的模块和模块相应的设置。参见
|
||
<span class="function"><a href="get_loaded_extensions.html" class="function">get_loaded_extensions()</a></span>。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_ENVIRONMENT</td>
|
||
<td>16</td>
|
||
<td>
|
||
环境变量信息也可以用 <var class="varname"><var class="varname"><a href="reserved.variables.environment.html" class="classname">$_ENV</a></var></var> 获取。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_VARIABLES</td>
|
||
<td>32</td>
|
||
<td>
|
||
显示所有来自 EGPCS (Environment, GET,
|
||
POST, Cookie, Server) 的 <a href="language.variables.predefined.html" class="link">
|
||
预定义变量</a>。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_LICENSE</td>
|
||
<td>64</td>
|
||
<td>
|
||
PHP许可证信息。参见 <a href="http://www.php.net/license/" class="link external">» license FAQ</a>。
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>INFO_ALL</td>
|
||
<td>-1</td>
|
||
<td>
|
||
显示以上所有信息。
|
||
</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.phpinfo-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 changelog" id="refsect1-function.phpinfo-changelog">
|
||
<h3 class="title">更新日志</h3>
|
||
<p class="para">
|
||
<table class="doctable informaltable">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>5.5.0</th>
|
||
<th>
|
||
Logo GUIDs were replaced with data URIs, and so turning off expose_php
|
||
now has no effect on the result of phpinfo(). Credits are also now
|
||
embedded within the output itself instead of linked.
|
||
</th>
|
||
</tr>
|
||
|
||
<tr>
|
||
<th>版本</th>
|
||
<th>说明</th>
|
||
</tr>
|
||
|
||
</thead>
|
||
|
||
<tbody class="tbody">
|
||
<tr>
|
||
<td>5.2.2</td>
|
||
<td>
|
||
增加了“已加载的配置文件”信息,之前只存在“配置文件路径(php.ini)"。
|
||
</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.phpinfo-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="example-527">
|
||
<p><strong>Example #1 <span class="function"><strong>phpinfo()</strong></span> 范例</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br /><br /></span><span style="color: #FF8000">// 显示所有信息,默认显示 INFO_ALL<br /></span><span style="color: #0000BB">phpinfo</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// Show just the module information. 仅仅显示PHP模块信息,<br />// phpinfo(8) 返回同样的结果。<br /></span><span style="color: #0000BB">phpinfo</span><span style="color: #007700">(</span><span style="color: #0000BB">INFO_MODULES</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 notes" id="refsect1-function.phpinfo-notes">
|
||
<h3 class="title">注释</h3>
|
||
<blockquote class="note"><p><strong class="note">Note</strong>:
|
||
<p class="para">
|
||
在 PHP 5.5 之前版本,当 <a href="ini.core.html#ini.expose-php" class="link">expose_php</a> 设置为 <em>off</em> 可以禁用一部分信息。
|
||
这包括了 PHP 和 Zend 的 logo,以及贡献者名单。
|
||
</p>
|
||
</p></blockquote>
|
||
<blockquote class="note"><p><strong class="note">Note</strong>:
|
||
<p class="para">
|
||
在命令行(CLI)模式下 <span class="function"><strong>phpinfo()</strong></span> 仅会输出纯文本,而不是HTML。
|
||
</p>
|
||
</p></blockquote>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 seealso" id="refsect1-function.phpinfo-seealso">
|
||
<h3 class="title">参见</h3>
|
||
<p class="para">
|
||
<ul class="simplelist">
|
||
<li class="member"><span class="function"><a href="phpversion.html" class="function" rel="rdfs-seeAlso">phpversion()</a> - 获取当前的PHP版本</span></li>
|
||
<li class="member"><span class="function"><a href="phpcredits.html" class="function" rel="rdfs-seeAlso">phpcredits()</a> - 打印 PHP 贡献者名单</span></li>
|
||
<li class="member"><span class="function"><a href="php_logo_guid.html" class="function" rel="rdfs-seeAlso">php_logo_guid()</a> - 获取 logo 的 guid</span></li>
|
||
<li class="member"><span class="function"><a href="ini_get.html" class="function" rel="rdfs-seeAlso">ini_get()</a> - 获取一个配置选项的值</span></li>
|
||
<li class="member"><span class="function"><a href="ini_set.html" class="function" rel="rdfs-seeAlso">ini_set()</a> - 为一个配置选项设置值</span></li>
|
||
<li class="member"><span class="function"><a href="get_loaded_extensions.html" class="function" rel="rdfs-seeAlso">get_loaded_extensions()</a> - 返回所有编译并加载模块名的 array</span></li>
|
||
<li class="member"><a href="language.variables.predefined.html" class="link">Predefined Variables</a></li>
|
||
</ul>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |