SetHandler & PHP (parsing pages through a php script)
| From: | C J Michaels | Date: | Tue, 08 Jan 2002 22:24:47 +0000 |
| Subject: | SetHandler & PHP (parsing pages through a php script) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79830@lists.php.net to get a copy of this message | ||
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.php
/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>
==========