I'm working on a custom mass hoting Apache module.
I need to be able to set the $DOCUMENT_ROOT value on a per
request basis. That is, I'd like to be able to set it in my module before
the clients' scripts run (similar to how I use zend_alter_ini_entry to
alter ini values).
I've tried using Apache's ap_table_set call to define the environment
variable, but PHP seems to clobber that and replace it.
Any thoughts?
Mark
I'm working on a custom mass hoting Apache module.
I need to be able to set the $DOCUMENT_ROOT value on a per
request basis. That is, I'd like to be able to set it in my module before
the clients' scripts run (similar to how I use zend_alter_ini_entry to
alter ini values).I've tried using Apache's ap_table_set call to define the environment
variable, but PHP seems to clobber that and replace it.Any thoughts?
This doesn't really have anything to do with PHP. You are writing an
Apache module. You simply have to change the doc_root before Apache gets
to the content handling phase of the request_rec. And to change the
doc_root I think you'd just fiddle with conf->ap_document_root and it
should all fall into place. But again, this has nothing to do with PHP.
-Rasmus