I am trying to change the path of a file (saved in /foo/bar directory) to the root
forexample
www.example.com/foo/bar/user.php
to
www.example.com/user.php
using chroot() function
<?php
chroot("/foo/bar/user.php");
$n=getcwd();
echo $n;
it's not working, I am getting the following php error :
call to undefined function chroot()
I am using php 5.3*, But I have also tested it on 5.4+ , still the same error. I am not sure if it is because of the the versions or something else,
Please help!
chrootfunction to do. What you did try to do with it makes no sense. The argument has to be a directory, and you appear to be giving it a file name. And there is nofooin the root of any of the standards I have come across, so the given path wouldn't exist either way.