reference/dir/functions/chroot.xml
625dc345dba34bd0e8f97b6fac4272a5e8359428
...
...
@@ -15,13 +15,18 @@
15
15
</methodsynopsis>
16
16
<para>
17
17
Changes the root directory of the current process to
18
-
<parameter>directory</parameter>.
18
+
<parameter>directory</parameter>, and changes the current
19
+
working directory to "/".
19
20
</para>
20
21
<para>
21
-
This function is only available if your system supports it and
22
-
you're using the CLI, CGI or Embed SAPI. Also, this function
22
+
This function is only available to GNU and BSD systems, and
23
+
only when using the CLI, CGI or Embed SAPI. Also, this function
23
24
requires root privileges.
24
25
</para>
26
+
<para>
27
+
Calling this function does not change the values of the <literal>__DIR__</literal>
28
+
and <literal>__FILE__</literal> magic constants.
29
+
</para>
25
30
</refsect1>
26
31

27
32
<refsect1 role="parameters">
...
...
@@ -32,7 +37,7 @@
32
37
<term><parameter>directory</parameter></term>
33
38
<listitem>
34
39
<para>
35
-
The new directory
40
+
The path to change the root directory to.
36
41
</para>
37
42
</listitem>
38
43
</varlistentry>
...
...
@@ -47,9 +52,32 @@
47
52
</para>
48
53
</refsect1>
49
54

55
+
<refsect1 role="examples">
56
+
&reftitle.examples;
57
+
<para>
58
+
<example><title><function>chroot</function> example</title>
59
+
<programlisting role="php">
60
+
<![CDATA[
61
+
<?php
62
+
chroot("/path/to/your/chroot/");
63
+
echo getcwd();
64
+
?>
65
+
]]>
66
+
</programlisting>
67
+
&example.outputs;
68
+
<screen>
69
+
<![CDATA[
70
+
/
71
+
]]>
72
+
</screen>
73
+
</example>
74
+
</para>
75
+
</refsect1>
76
+

50
77
<refsect1 role="notes">
51
78
&reftitle.notes;
52
79
&note.no-windows;
80
+
&note.no-zts;
53
81
</refsect1>
54
82
</refentry>
55
83

56
84