Re: SetHandler & PHP (parsing pages through a php script)
| From: | C J Michaels | Date: | Thu, 10 Jan 2002 18:20:13 +0000 |
| Subject: | Re: SetHandler & PHP (parsing pages through a php script) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80057@lists.php.net to get a copy of this message | ||
Thanks to the help of Philip Hallstrom we discovered a solution to my
problem. I'm posting it for posterity.
Apache seems to be able to use the mime type for SetHandler, so...
SetHandler application/x-httpd-php
...works perfectly.
Thanks,
--Chris
C J Michaels wrote in message <20020108222114.25305.qmail@pb1.pair.com>...
>Server version: Apache/1.3.22 (Unix) + mod_php/4.1.1
>
>Hello,
>
>Short Question:
>What is php's apache handler, i.e. for use with the "SetHandler" statement?
>
>Longer Version:
>I would like to parse every URI that is requested on a certain VirtualHost,
>through a specific PHP script. I have _almost_ figgured out a way to do it
>but I've run into one snag. Below is the config I am using.
>
>I am using "Action" to assign a handler to a specific php script and then
>using "SetHandler" in the VHost to use that script.
>
>If I use a script that is not in a directory that falls under the one I
>specified "SetHandler" in it works fine. If the script falls under the
same
>dir that has the "SetHandler" specified, I get sucked into a loop. I'll
>eventually get an error to the effect of:
>
>Forbidden:
>/path-to/script.php/path-to/script.php/path-to/script.php/path-to/script.ph
p
>/path-to/script.php/path-to/script.php/URL-REQUESTED
>
>The kicker here being, is that I want EVERY url on the server to be
>processed by the .php script I specify, so everything on that server (even
>the script) falls under the "SetHandler" directive.
>
>I cannot seem to find a way to disable the "SetHandler" but I can specify a
>new one. Problem is, I have no clue what to use for the "SetHandler"
>statement that would force it to be processed by php.
>
>Any assistance would be greatly appreciated. I'm open to alternate
>solutions to my root problem.
>
>--Chris
>
>=========
><VirtualHost *:80>
>ServerName myserver.mydomain.org
>DocumentRoot /usr/local/www/myserver
>Action php-parse /path-to/script.php
>
><Directory "/usr/local/www/myserver">
> SetHandler php-parse
> allow from all
> order allow,deny
></Directory>
></VirtualHost>
>==========
>
>