Jump to content


Photo

Set an Apache PHP File Handler


  • Please log in to reply
2 replies to this topic

#1 tdromba

tdromba
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 April 2003 - 08:26 PM

Hi All:

I\'m asking for a little help using some of Apache\'s file handling functionality. First of all, here\'s my server configuration:

Apache/1.3.27 PHP/4.1.2 on FreeBSD.

I need to set up a php file handler for file types .xyz. So, the client requests foo.xyz, and it gets piped to my php file handler and then on to the client. I tried adding this to httpd.conf:

AddHandler php-xyz-parser /home/none/www/xyz_parser.php

<FilesMatch "*.xyz">

    SetHandler php-xyz-parser

</FilesMatch>

But got nothing, the .xyz file is apparently not being parsed. If anyone has dealt with this or a similar problem, I would love to hear from you!

Thanks in advance for your help.

TD

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 23 April 2003 - 06:57 AM

have no knowledge on this... the apache docs had an example like this:

Action add-footer /cgi-bin/footer.pl
AddHandler add-footer .html


try with the Action, or would something like this suffice?

http://www.phpfreaks...orials/34/0.php
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 tdromba

tdromba
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 April 2003 - 01:53 PM

Thanks for your note.

The tricky thing about what I need to pull off is that the .xyz files are not php files, they\'re data files that I need to parse with php. So, adding the type:

AddType application/x-httpd-php .php .xyz

parses the data files with php, but, there\'s no php in the .xyz file. What has to happen is apache needs to hand the .xyz file to the php handler to be processed ... tricky. But, I know it can be done with perl, why not php??? :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users