Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Thantos - joulukuu 02, 2005, 01:55:28 AP

Otsikko: faking an xml document with php
Kirjoitti: Thantos - joulukuu 02, 2005, 01:55:28 AP
I'm thinking about setting up a Package Server for my stuff but its hardcoded to use packages.xml
Now this isn't really a problem but I'd like to dynamically create the file.
So does anyone know a way I can create a php document that'll execute and output when someone goes for packages.xml?

Apache 2 with php 5 running on debian.
Otsikko: Re: faking an xml document with php
Kirjoitti: Grudge - joulukuu 02, 2005, 08:10:53 AP
I believe your best bet is to put in a .htaccess file into your package directory to tell Apache to pass that file as PHP. I can't remember the syntax, but if you check your current http.conf file and search for php you'll find the line which tells apache which files to run php on.
Otsikko: Re: faking an xml document with php
Kirjoitti: Thantos - joulukuu 02, 2005, 08:14:43 AP
Thanks

Edit:
AddType application/x-httpd-php .xml did it for me :)  Thanks again