PHP.nl

chroot

chroot

Change the root directory

bool **chroot** string $directory

Changes the root directory of the current process to , and changes the current working directory to "/". directory

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.

Calling this function does not change the values of the and magic constants. __DIR__``__FILE__

directoryThe path to change the root directory to.

return.success

Voorbeeld: example

<?php
chroot("/path/to/your/chroot/");
echo getcwd();
?>
/