Restricting PHP Execution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben

    Restricting PHP Execution

    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!
    -Ben

  • Sjoerd

    #2
    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
    AddType/RemoveType.

    Comment

    Working...