Page 1 of 1

set root in php: chroot?

Posted: Sat Oct 21, 2006 10:53 pm
by potato
Hey,

does anybody knows how to set the root in php?
i found chroot php function.

But i get 'Call to undefined function: chroot()' error.
how do i call this function properly?

I've seen that this function requires at least vesrion 4.0.5
Mine is 4.4.4, so normally that wouldn't be a problem.

Anyone knows?

thanx

Posted: Sat Oct 21, 2006 11:00 pm
by potato
i also found that your server has to be configured for the chroot function.

How i check if it is configured or not?

Posted: Sat Oct 21, 2006 11:20 pm
by s.dot
you could try this little piece of code to see if the function is available to you

Code: Select all

if(function_exists('chroot'))
{
   echo 'exists';
} else
{
   echo 'does not exist';
}

Posted: Sat Oct 21, 2006 11:26 pm
by potato
ok, its not available

is there another way of doing it?

ps thanx for the reaction

Re: set root in php: chroot?

Posted: Sun Oct 22, 2006 4:21 am
by volka
Bevibed.be wrote:I've seen that this function requires at least vesrion 4.0.5
Mine is 4.4.4, so normally that wouldn't be a problem.
There are more requirements
http://de2.php.net/chroot wrote:This function is only available if your system supports it and you're using the CLI, CGI or Embed SAPI.