How to Restrict PHP Scripts
I have a dilemma: I need to restrict hosting customers so that their PHP scripts are only able to access or include files from their personal directories. I use cPanel/WHM; each of my clients' directories are /home/[USERNAME]. I have thought of using open_basedir - however, this will be problematic because I will have to either insert a unique open_basedir in each of the VirtualHosts in httpd.conf or modify cPanel/WHM's account creation script (/scripts/wwwacct) to do it automatically. I was wondering if you can use a wildcard in a PHP configuration value in the following way:
Code:
php_admin_value open_basedir "/home/*"
Code:
Warning: main(/home/djbob/public_html/signup/functions.php): failed to open stream: Permission denied in /tmp/cpanel_phpengine.1142557952.18984614.260966694964 on line 12
Thanks for helping!