Curious if you can tell PHP to chroot to a users $DOCUMENT_ROOT
path.
I'm using a bunch of Apache rewrite rules to map the document root
to the users web directory. The DOCUMENT_ROOT variable doesn't
get updated with the final outcome of apache's rewrite rules; It stays
set to the variable in apache's httpd.conf file.
I'm wondering if I could use the rewrite rules, then have PHP trap the user
in a chroot jail, so that when they use require/include, they could specify
"/setup.php" instead of,
// Get Document Root
$root = SubStr($SCRIPT_FILENAME, 0, Strrpos($SCRIPT_FILENAME, "/") );
include "$root/setup.php";
Another reason to do this, is that I'd love to be able to hide the directory
layout to protect my users against any malicious ones.
Thanks for any help,
-Allan