mr_daemon Posted April 2, 2003 Share Posted April 2, 2003 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 More sharing options...
0 [idkfa] Posted April 2, 2003 Share Posted April 2, 2003 does the file actually exist? you need to copy your .php-file to .phps Link to comment Share on other sites More sharing options...
0 nocture Posted April 2, 2003 Share Posted April 2, 2003 sounds strange... try add the .phps extension to windows first if you havent done that Link to comment Share on other sites More sharing options...
0 mr_daemon Posted April 2, 2003 Author Share Posted April 2, 2003 The file DOES exist, and BTW Nocture, that server is running Linux ;) Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted April 2, 2003 Veteran Share Posted April 2, 2003 just call it .phps ? Link to comment Share on other sites More sharing options...
0 nocture Posted April 2, 2003 Share Posted April 2, 2003 right, well then i dont know the problem if you havent called the file x.phps Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted April 2, 2003 Veteran Share Posted April 2, 2003 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 More sharing options...
0 john smith 1924 Veteran Posted April 2, 2003 Veteran Share Posted April 2, 2003 addditionally, if they were just .php and you still got 404 / whatever errors then something else has gone wrong... Link to comment Share on other sites More sharing options...
0 Pizass Posted April 3, 2003 Share Posted April 3, 2003 and in php.ini it has the color settings. Make sure those are right. Link to comment Share on other sites More sharing options...
0 Nodiaque Posted April 3, 2003 Share Posted April 3, 2003 did you compile php with the source automatically highlighted and --with-source if I remember well? Link to comment Share on other sites More sharing options...
0 mr_daemon Posted April 3, 2003 Author Share Posted April 3, 2003 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 More sharing options...
0 Nodiaque Posted April 3, 2003 Share Posted April 3, 2003 I found the prob, its not AddType application/x-httpd-php-source .phps but this: AddType application/x-httpd-php-source phps remove the dot Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted April 3, 2003 Veteran Share Posted April 3, 2003 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 More sharing options...
0 Nodiaque Posted April 3, 2003 Share Posted April 3, 2003 The dots isn't there in apache 2, that's why I mistaken Link to comment Share on other sites More sharing options...
0 Nodiaque Posted April 3, 2003 Share Posted April 3, 2003 php 4 or php 3? Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted April 3, 2003 Veteran Share Posted April 3, 2003 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 More sharing options...
0 mr_daemon Posted April 3, 2003 Author Share Posted April 3, 2003 ;) Well, actually... Does that means I *HAVE* to use Apache 2 for this to work? (Nodiaque said the dots weren't there in apache2, not me ;P) Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted April 3, 2003 Veteran Share Posted April 3, 2003 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 More sharing options...
0 mr_daemon Posted April 4, 2003 Author Share Posted April 4, 2003 Well for some reason, it just decided to work o.o I have no clue why. Oh well. Thanks for your help guys! Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted April 4, 2003 Veteran Share Posted April 4, 2003 W00t! The random self-bugixing code must have kicked in ;) Link to comment Share on other sites More sharing options...
Question
mr_daemon
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