PHP chroot() Function

The chroot() function changes the root directory of the current process to directory, and changes the current working directory to "/".Changes the root directory of the current process to directory, and changes the current working directory to "/".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.

Example -