• 0

.phps syntax highlighting?


Question

Hi!

I've seen many people use .phps files to show the source code of PHP scripts -- automatically highlighted properly.

I read around the net and found out that you have to add

AddType application/x-httpd-php-source .phps

to your apache configuration. So I did that and restarted apache, however when I try to access a .phps file, it acts just like the file was not found.

What am I doing wrong?

Also, I am NOT using Apache 2 if that helps, and the server is running Linux. And PHP was configured --with-apache.

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

lol - yeah

that first thing you do associates the file type .phps with php under apache, like going into file manager in windows and associating mp3s with winamp. You do actually have to call the files xxx.phps !

and then it shows up all nicey nice :)

Link to comment
Share on other sites

  • 0

I don't think there's a compile time option for that.

And perhaps I just explained wrong, I mean, the file IS called whatever.phps

However, I yet have to check my php.ini for the colors -- that might be it.

As for associating files... well...

AddType application/x-httpd-php-source .phps

That does the trick.

It shows a 404 whenever I load it, that's what bothers me.

Link to comment
Share on other sites

  • 0
AddType application/x-httpd-php .php3

#AddType application/x-httpd-php3-source .phps

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

AddType application/x-tar .tgz

AddType application/x-BitTorrent .torrent

http://dorm.timdorr.com:81/experiments/system.phps

Nope, the dot's supposed to be there...

Link to comment
Share on other sites

  • 0

Nope, I'm using Apache 1 over here and it works fine (as you can see by the link). If you remove the AddType line, does the file not 404?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.