httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] logging php usage and directory index pages
Date Sun, 11 Nov 2007 18:08:14 GMT
On Nov 11, 2007 12:21 PM, Alex Dean <> wrote:
> Can anyone help with this?
> wrote:
> > Two questions about logging:
> >
> > 1. Can I log whether or not the current request was operated on by mod_php?
> >
> > I want to determine what % of my requests are PHP.  I've tried to
> > determine this based on filename, but with ForceType and other
> > configuration directives, it's possible for a file to be parsed as PHP
> > even if it doesn't have the .php file extension.
> >
> > I saw the log formatter "%...{Foobar}n      The contents of note Foobar
> > from another module.", and that sounds promising, but I'm really not
> > sure what it means, or what value I might use for {Foobar}.
> >

I believe php adds a special http response header to its requests
(X-Powered-By: php or something like that). You can log that.

> >
> > 2. Can I log the actual file that was served, even for directory indexes?
> >
> > I've tried the '%f' log format, and for requests, I get
> > a log of '/var/www/'.  If the directory index file was
> > 'index.html', I'd like '/var/www/' to get into
> > the log somehow.

I don't believe that is possible. There are many ways that a request
can get mapped to a file, so there is no way for apache to determine
definitively what has happened. You can take a look at the different
available environment variables (using a printenv cgi script) and try
turning RewriteEnging On, which sets a few extra variables.


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