You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amlaan Kar <am...@gmail.com> on 2016/07/19 05:15:29 UTC
[users@httpd] Run PHP Handler after running my handler Apache
I have created a handler in Apache which is supposed to parse the URL
entered. If the conditions defined by the handler are satisfied, the
handler returns DECLINED AND the page requested is open. If not, the
handler displays "Rejected". However, the problem I am facing is that when
I am trying to display a PHP page, the PHP handler does not help execute
the PHP code after my handler returns DECLINED. I have included the
following lines in my httpd.conf file:
LoadModule example5_module modules/mod_example5.so<FilesMatch \.php$>
SetHandler example5-handler
AddHandler application/x-httpd-php .php</FilesMatch>
Here, example5_module is the module I wrote and example5-handler is my
handler. The handler works completely fine and does its job of parsing the
URL but on success it shows a blank page instead of executing the PHP code.
I have also checked that PHP is working properly if I remove my handler.
Please help me make my handler and the PHP handler work together.
Re: [users@httpd] Run PHP Handler after running my handler Apache
Posted by Amlaan Kar <am...@gmail.com>.
Sir, it would be great if you could elaborate on how to hook up the
module's processing earlier in the cycle. I am parsing the query string and
checking if the parameter's value is alphanumeric or not. So what do I use
as condition in the <If> clause? Besides, <Location> does not work.
On Tue, Jul 19, 2016 at 11:44 AM, Nick Kew <ni...@apache.org> wrote:
> On Tue, 2016-07-19 at 10:45 +0530, Amlaan Kar wrote:
> > I have created a handler in Apache
>
> Sounds like your module's processing should be hooked up
> earlier in the cycle. It can then set the handler either
> to PHP or to its own page according to the outcome of
> whatever parsing it does.
>
> But given that the server parses the URL, you can probably
> dispense with that altogether, and use configuration to
> deal with whatever your parser does. If <Location>
> or <LocationMatch> is not sufficient, then an <If> clause.
> Or even the archaic tool of yesteryear, mod_rewrite.
>
> --
> Nick Kew
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] Run PHP Handler after running my handler Apache
Posted by Amlaan Kar <am...@gmail.com>.
<Location>, <If> and mod_rewrite do not work here as I am reading the query
string parameter from a xml file and thus cannot declare it in the
configuration file.
However, it would be really helpful if you would help me understand how a
module's processing can be hooked up
earlier in the cycle as this seems to be the only way to make it work.
On Tue, Jul 19, 2016 at 11:44 AM, Nick Kew <ni...@apache.org> wrote:
> On Tue, 2016-07-19 at 10:45 +0530, Amlaan Kar wrote:
> > I have created a handler in Apache
>
> Sounds like your module's processing should be hooked up
> earlier in the cycle. It can then set the handler either
> to PHP or to its own page according to the outcome of
> whatever parsing it does.
>
> But given that the server parses the URL, you can probably
> dispense with that altogether, and use configuration to
> deal with whatever your parser does. If <Location>
> or <LocationMatch> is not sufficient, then an <If> clause.
> Or even the archaic tool of yesteryear, mod_rewrite.
>
> --
> Nick Kew
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] Run PHP Handler after running my handler Apache
Posted by Dr James Smith <js...@sanger.ac.uk>.
I use something similar - you should really be applying this in one of
the AAA level of handlers (I use mod_perl rather than C handlers) but
there are various places you can hook into the process
Usually (and slightly naughtily) I add this to the access handler within
mod_perl {it does the user/ip identification and then performs the
appropriate filters}
If you are doing complex access layers (e.g. checking permissions in a
db) you may not be able to do this with Location/LocationMatch
On 19/07/2016 07:14, Nick Kew wrote:
> On Tue, 2016-07-19 at 10:45 +0530, Amlaan Kar wrote:
>> I have created a handler in Apache
> Sounds like your module's processing should be hooked up
> earlier in the cycle. It can then set the handler either
> to PHP or to its own page according to the outcome of
> whatever parsing it does.
>
> But given that the server parses the URL, you can probably
> dispense with that altogether, and use configuration to
> deal with whatever your parser does. If <Location>
> or <LocationMatch> is not sufficient, then an <If> clause.
> Or even the archaic tool of yesteryear, mod_rewrite.
>
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Run PHP Handler after running my handler Apache
Posted by Nick Kew <ni...@apache.org>.
On Tue, 2016-07-19 at 10:45 +0530, Amlaan Kar wrote:
> I have created a handler in Apache
Sounds like your module's processing should be hooked up
earlier in the cycle. It can then set the handler either
to PHP or to its own page according to the outcome of
whatever parsing it does.
But given that the server parses the URL, you can probably
dispense with that altogether, and use configuration to
deal with whatever your parser does. If <Location>
or <LocationMatch> is not sufficient, then an <If> clause.
Or even the archaic tool of yesteryear, mod_rewrite.
--
Nick Kew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org