php-doc-en/reference/dir/functions/chroot.xml
2011-02-23 11:46:53 +00:00

98 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- splitted from ./en/functions/dir.xml, last change in rev 1.11 -->
<refentry xml:id="function.chroot" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>chroot</refname>
<refpurpose>Change the root directory</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>chroot</methodname>
<methodparam><type>string</type><parameter>directory</parameter></methodparam>
</methodsynopsis>
<para>
Changes the root directory of the current process to
<parameter>directory</parameter>, and changes the current
working directory to "/".
</para>
<para>
This function is only available to GNU and BSD systems, and
only when using the CLI, CGI or Embed SAPI. Also, this function
requires root privileges.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>directory</parameter></term>
<listitem>
<para>
The path to change the root directory to.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example><title><function>chroot</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
chroot("/path/to/your/chroot/");
echo getcwd();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
/
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.no-windows;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->