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

    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

      Hi!

      Try this in php.ini

      doc_root = /wwwroot/gooddir

      CU

      Dominik

        Write a Reply...