Restricting PHP Execution

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am running Apache 1.3.33 and PHP 4.3.11.  Is there a way, either via
httpd.conf or php.ini, to restrict which directories can be used for
the execution of PHP scripts similar to how you can restrict cgi
scripts to be allowed to run only if they are in a cgi-bin directory.

Thanks for the help!

Re: Restricting PHP Execution

In a Location or VirtualHost directive, in httpd.conf:
RemoveType .php
This removes the binding between .php files and the PHP interpreter.
People probably see the source of the php file. You can display it as
HTML by using:
AddType text/html .php

See the Apache documentation for more info on how to use

Re: Restricting PHP Execution

Quoted text here. Click to load it

The apache directive you refer to I think is called a ScriptAlias.  
There's also the ExecCGI option on a directory.  Read up on the Apache  
configuration documentation for details.  I think that's a good place to  

DeeDee, don't press that button!  DeeDee!  NO!  Dee...

Site Timeline