Two months ago I was looking for a way to let apache serve python scripts as plain text. Today I had the same problem with php files. Here is my solution.
What you need is a .htaccess file in the same directory as the files you want to serve, with the following directive in it:
AddType text/plain .php
Be carefull: within the directory, anybody will be able to look the source code of all files with .php extension.
As suggested by SnakEyez on the e107 forum, there is another way to do that, using the following directive in the
.htaccessfile:You may also need to add the following directive before the
AddTypeone:FYI, I had to add this on my case because I run the CGI version of PHP.