Well ... I use it like so:
1) I have multiple obj.conf files - bare.obj.conf, bare-php.obj.conf, etc. I associate particular virtual servers with particular obj.conf files in the server.xml:
<object-file>obj/bare-php.obj.conf</object-file>
Adding PHP support for a VS is as easy as changing the obj.conf it's associated with int he server.xml and running the reconfig script.
2) In the bare-php.obj.conf file I configure the FastCGI engine:
Service fn=responder-fastcgi
app-path="/export/WS7/third-party/php/php_fcgi"
req-retry=5
type="*magnus-internal/fastcgi*"
app-env="PHPRC=/export/WS7/https-www.foo/config"
app-env="PHP_FCGI_CHILDREN=5"
app-env="PHP_FCGI_MAX_REQUEST=200"
min-procs=1
restart-interval=10
bucket="php-bucket"
rlimit_cpu=60
All my PHP enabled virtual servers (about a dozen or so) share a single FastCGI/PHP engine. I think it would be pretty trivial to use the predefined variables in WS.
Borrowing somewhat from Chris Elving's example at: http://blogs.sun.com/elving/entry/mass_virtual_hosting_in_7
Service fn=responder-fastcgi
app-path="/path/to/php/php_fcgi"
bind-path="$(lc($urlhost))"
req-retry=5
type="*magnus-internal/fastcgi*"
app-env="PHPRC=/path/to/users/$(lc($urlhost))/config"
app-env="PHP_FCGI_CHILDREN=5"
app-env="PHP_FCGI_MAX_REQUEST=200"
min-procs=1
restart-interval=10
bucket="php-bucket"
rlimit_cpu=60
I
think this would use the same PHP binary for everyone (the one located at /path/to/php/php_fcgi), but each PHP process would have its own named Unix Domain Socket (UDS) named after the URL host. This would also pick up a unique php.ini file from a path on the file system (again, named after the URL host name).
But of course your mileage may vary, I haven't tried it, etc.