httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] Apache2 content generators
Date Thu, 05 Nov 2009 20:33:28 GMT
antoine wrote:
> Eric Covener wrote:
>> On Thu, Nov 5, 2009 at 10:25 AM, antoine <> wrote:
>>> The first one(mine) adds some stuff to the html body and the
>>> second one is the mod_php that takes the first's results and gives the
>>> client the final page.
>> Is running PHP as a filter deprecated?  That'd be an option.
> Sorry can you explain better. Thanks

Let me roll back a little bit, and then get back to Erik's question above.

Basically, there can only be one Apache "response generator" module.

There can be "input" filters before : they filter the HTTP request and 
can do something to the request, but not to the result yet, because it 
is not yet created.

Then there is one "response generator".  That is the one which (usually) 
gets the basic document from disk (or creates it from scratch), modifies 
it or not, and produces the HTTP response.

Then there can be more "output" filters, which act on the response 
already produced by the response generator above, and can modify it some 

I am unfamiliar with mod_php, but I imagine that it usually functions 
itself like the "response genrator" above.  Thus, it picks up a document 
from disk, examines it to see if it contains any php to process, and if 
yes it processes this php and modifies the original document 
accordingly. Then it sends out the result as an HTTP response.

If that is how it works, then it is going to be difficult for you to 
insert something else before it.  Because then, your module would have 
to pick up the page from disk, do something to it, and then figure out a 
way to pass that modified document to mod_php to process.  But mod_php 
wants to pick up the original from disk also, so you have a problem.

On the other hand, if mod_php, like Erik mentions above, can also be 
configured to work as an output filter (instead of as the content 
generator), then this may be the solution.
Your module could then be "content generator" : pick up the original 
document from disk, produce a HTTP response, and that response would 
then be processed by mod_php acting as an output filter.

Got it ?
Now you have to check yourself if mod_php /can/ be configured to work as 
an output filter, like Erik seems to hint that it can, or could.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message