Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Fix for PHP Source showing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix for PHP Source showing
Authored by: aramis on Dec 23, '03 03:15:48PM

I found I needed to do two additional things to get PHP alive. (This is on a virgin Panther install).

1) sudo cp /etc/php.ini.default /etc/php.ini
2) Add the following line to /etc/httpd/httpd.conf:
AddType application/x-httpd-php .php

Without the AddType bit, all I got was the source of the PHP page I was trying to hit.

Best regards,
Zac Bedell



[ Reply to This | # ]
Fix for PHP Source showing
Authored by: Anonymous on Aug 30, '04 09:06:13PM
In 10.3.5 you don't need to put in the AddType command because the config file already has code to turn on recognition of .php files if the mod_php4.c is also turned on. Here's the stock code from the .conf file:

<IfModule mod_php4.c>
    # If php is turned on, we repsect .php and .phps files.
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    # Since most users will want index.php to work we
    # also automatically enable index.php
    <IfModule mod_dir.c>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>


[ Reply to This | # ]