mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
91 lines
3.0 KiB
HTML
91 lines
3.0 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>改变根目录</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.chroot" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">chroot</h1>
|
||
<p class="verinfo">(PHP 4 >= 4.0.5, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">chroot</span> — <span class="dc-title">改变根目录</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.chroot-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>chroot</strong></span>
|
||
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$directory</code></span>
|
||
) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
将当前进程的根目录改变为
|
||
<code class="parameter">directory</code>。
|
||
</p>
|
||
<p class="para">
|
||
本函数仅在系统支持且运行于 CLI,CGI
|
||
或嵌入 SAPI 版本时才能正确工作。此外本函数还需要 root 权限。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.chroot-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">directory</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
新目录
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.chroot-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.chroot-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="example-2747"><p><strong>Example #1 <span class="function"><strong>chroot()</strong></span> example</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br />chroot</span><span style="color: #007700">(</span><span style="color: #DD0000">"/path/to/your/chroot/"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">getcwd</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
<div class="example-contents"><p>以上例程会输出:</p></div>
|
||
<div class="example-contents screen">
|
||
<div class="cdata"><pre>
|
||
/
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 notes" id="refsect1-function.chroot-notes">
|
||
<h3 class="title">注释</h3>
|
||
<blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数未在 Windows 平台下实现。</span></p></blockquote>
|
||
</div>
|
||
|
||
</div></div></div></body></html> |