Koozali.org: home of the SME Server

custom file suffix parsing

brad wright

custom file suffix parsing
« on: July 05, 2001, 08:01:46 PM »
Hi all,
how do I get e-smith to parse all files with a .xxx  suffix through PHP?
at present, if i ask for a file abc.php in my web browser, it parses the contents of the file thru PHP before dilivering it (via appache), how do I get PHP to parse a file eg. abc.xxx as a PHP file??
I hope I make sense here.

Thanks for the help,
Brad

Dan Brown

Re: custom file suffix parsing
« Reply #1 on: July 05, 2001, 08:40:59 PM »
Why on earth would you want to?  In any case, you'd do this by editing /etc/e-smith/templates/etc/httpd/conf/httpd.conf/S95AddType00PHP2ibays, and adding the .xxx extension on line 23.

Probably better if you copied that file to an appropriate directory in /etc/e-smith/templates-custom before editing it, though.

brad wright

Re: custom file suffix parsing
« Reply #2 on: July 05, 2001, 08:48:38 PM »
Dan,
i simply want to enable the use of the file suffix '.inc' so I can use .inc files as include files. Just makes it easier to fiollow tutes/how-to's relating to PHP as they seem to use the .inc suffix by convention for included files.

Do you think  this is a misguided view? I'm interested in hearing another view.

Cheers,
Brad

Filippo Carletti

Re: custom file suffix parsing
« Reply #3 on: July 05, 2001, 09:33:05 PM »
.inc suffix for php includes is considered bad practice.
Search the bugtraq archives for "A study in scarlet".

Dan Brown

Re: custom file suffix parsing
« Reply #4 on: July 05, 2001, 09:40:05 PM »
Irrespective of whether it's a bad practice or not, if they're included from a .php file, PHP will parse .inc (or .txt, or any other extension) files.

brad wright

Re: custom file suffix parsing
« Reply #5 on: July 06, 2001, 08:43:47 AM »
Fillipo,

I tried to find that reference, however bugtraq archives didn't have anything when searched, do you have a URL or copy of the article?? I'm very interested to read it.

Thanks,
Brad

Dan Brown