Easy Tutorial
❮ Func Misc Ignore User Abort Filter Validate Ip ❯

PHP chroot() Function

PHP Directory Reference Manual

Example

Change the root directory:

Result:


Definition and Usage

The chroot() function changes the root directory of the current process to directory and changes the current working directory to "/".

Note: This function requires root privileges and is only available on GNU and BSD systems when using CLI, CGI, or embedded SAPI. This function is not implemented on Windows platforms.


Syntax

Parameter Description
directory Required. Specifies the new root directory path.

Technical Details

Return Value: Returns TRUE on success, FALSE on failure.
PHP Version: 4.0.5+
--- ---
❮ Func Misc Ignore User Abort Filter Validate Ip ❯