Jump to content

chroot not working ?


Recommended Posts

I'm trying to set chroot.

I get the following error message:


( ! ) Fatal error: Call to undefined function chroot() in X:\wamp\www\dir1\dir2\test-getcwd.php on line 5

Call Stack









{main}( )



my script is like this:


    echo getcwd() . "\n"; 
    chroot('X:\wamp\www\dir3') . "\n";
    echo getcwd() . "\n";


Is it possible chroot is not default set in wamp or am I making a mistake?

Link to comment
Share on other sites

The first thing I would check is what version of PHP you're running.



It looks like there's a note in the manual http://php.net/chroot


This function is only available to GNU and BSD systems, and only when using the CLI, CGI or Embed SAPI. Also, this function requires root privileges.

Edited by Ingolme
Information in the PHP manual
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...