• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Adding .phps to Apache2

I want to make my php scripts available to the public, I know that you can copy the file to an extension of phps to see a color-formatted source. But I don't know how to do it on my own installation of Apache2 and php (on Windows XP). What I have done is added these two lines to httpd.conf:
AddType application/x-httpd-php-source .phps
Action application/x-httpd-php-source "/php/php.exe -s"
But when I click on a phps file, I get a file not found error. If I remove these two lines, restart Apache2 and click them again, I get the source, but no colors.
What should I do to enable colorformatted phps viewing?
However, the question still stands, as it is easy to quickly copy/rename a file when someone asks for the source.
In addition to my question:
I don't know if this is a bug in Firebird, but when I click a link with a .msi or .rar file, instead of downloading the file, it shows the binary code in the browser window. How can I tell Apache to tell the browser to download the file? Or is this browser-related?

I can understand why some of you people think RTFM!, but I don't quite understand the manual sometimes, maybe this is because English is not my native language, or maybe I am too much of a n00b.


I may actually be insane.
The advantage of show_source is that the source is updated as the file is, not good if there are passwords in the file, but ok for most uses (btw, all .phps files I've seen just display plain text, unless they where created from the command line/with cat)

As for FireBird, it can be both, but most of the time its to do with MIME types, theres info on how to add them to apache here: http://www.bignosebird.com/apache/a1.shtml


Political User
I have always seen anything with phps on the end as color coded PHP souce, so yeah.

Anyways, the addtype is all you should need, i dont know though.


Political User
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Is what i got in my config file. Apachel 1.3.x


I'm sorry Hal...
Political User
I felt it had more relevancy, and would get better response, in here.

How can you spend 15 minutes looking for any post. See the search buton below every post. It will list every post by that member

Members online

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member