downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

dir> <chdir
[edit] Last updated: Fri, 18 Sep 2009

view this page in

chroot

(PHP 4 >= 4.0.5, PHP 5)

chrootChange the root directory

Описание

bool chroot ( string $directory )

Changes the root directory of the current process to 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.

Параметри

directory

The new directory

Връщани стойности

Връща TRUE при успех или FALSE при неуспех.

Бележки

Забележка: Тази функция не е налична на Windows платформи.



add a note add a note User Contributed Notes chroot
nmmm at nmmm dot nu 20-Nov-2011 10:05
on my system this function is missing (Linux, php-cli), so I did:

if ( function_exists("chroot") ){
       chroot($chroot);
       server_log("chroot() to $chroot", 1);
}else{
       server_log("Can not chroot(). Will try live without it.");
}

 
show source | credits | stats | sitemap | contact | advertising | mirror sites