Click to See Complete Forum and Search --> : PHP Root Directory


Anon
08-08-2000, 04:58 PM
We're wanting to install PHP on a server here, but we need a way to set it up such that the Apache webserver will ONLY serve PHP documents that are in a certain directory (kind of like CGI scripts). So, if someone tries to put a script into wwwroot/baddir/test.php it will not run, but if the same script is in wwwroot/gooddir/test.php, it WILL run. Any ideas?

-Jade

Anon
08-08-2000, 06:21 PM
In your httpd.conf

remove the global entries
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

and put them in a Directory section
<Directory "/wwwroot/gooddir">
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
....
the rest of the section
....
</Directory>


Hope this helps

JBL

Anon
08-08-2000, 09:28 PM
Hi!

Try this in php.ini

doc_root = /wwwroot/gooddir

CU

Dominik