Treat *.php as text files

Discussion in 'Apache' started by AHA7, Jan 8, 2008.

  1. #1
    Hello,

    I have an Apache server and I want it not to process .php files as PHP but rather a normal text files, how can I do that?

    I want the server to process files with extension .pro as PHP files (they are going to contain PHP code and I want it executed on the server) and files with .php extension as text files (they are going to contain PHP code but I don't want it executed. I want the server to respond with the .php file as if it was a text file.)
     
    AHA7, Jan 8, 2008 IP
  2. norbert

    norbert Guest

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make .pro files be treated as PHP:
    Look for this line in your configuration. On my system here (OpenSUSE 10.2) it's in
    /etc/apache2/conf.d/php5.conf:
    AddHandler application/x-httpd-php .php
    and change it to
    AddHandler application/x-httpd-php .pro

    To display the source of PHP files add this line:
    AddHandler application/x-httpd-php-source .php
     
    norbert, Jan 8, 2008 IP