w3resource logo


PHP : chroot function

PHP : chroot() function

<<PreviousNext>>

Description

The chroot() function is used to change the root directory of the current process to the specified directory.
This function is only available if your system supports it and you're using the CLI, CGI or Embed SAPI. Also, this function requires root privileges.

Version

(PHP 4 and above)

Syntax

chroot(directory_name)

Parameter

Name Description Required /
Optional
Type
directory_name The new directory. Required String

Return value

TRUE on success and FALSE on failure.

Value Type : Boolean.

See also

PHP Function Reference

<<PreviousNext>>

Rate this tutorial


Your Rating: not set

Share this tutorial

RSS Feed