chroot

(PHP 4 >= 4.0.5, PHP 5)

chroot -- 改变根目录

说明

bool chroot ( string directory )

将当前进程的根目录改变为 directory

本函数仅在系统支持且运行于 CLI,CGI 或嵌入 SAPI 版本时才能正确工作。此外本函数还需要 root 权限。

参数

directory

新目录

返回值

如果成功则返回 TRUE,失败则返回 FALSE

注释

注: 本函数未在 Windows 平台下实现。


add a note add a note User Contributed Notes
php at schlueters dot de
09-Feb-2003 11:52
PHP needs to be configured with --enable-chroot-func and on my machine only root can use it (user users get "Operation not permitted (errno 1)")