Adding .phps to Apache2

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
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:
Code:
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?
 
Thanks.
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.
 
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
 
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.
 
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>

Is what i got in my config file. Apachel 1.3.x
 
WTF is this thread doing in Coding and Design? I have spent 15 mins searching for it, (it was originally posted in Applications)
 
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
 
Hey, geen slechte taal. Ook al is het in het nederlands, er zijn nog meer nederlanders.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back