[FASTCGI] FastCGI PHP runtime configuration

Michiel Brandenburg apex at xepa.nl
Sun Nov 9 14:50:36 EST 2008


Simon wrote:
> I know some of you guys use FastCGI to run PHP scripts. Had anyone figured
> out how to load runtime configuration parameters, such as those you can
> load from .htaccess if PHP is run as a module, for each instance of FCGI request?
> I know it is possible to load different php.ini for a poll of FCGI PHP processes
> but I need to be able to load different php.ini or set of runtime parameters for
> each FCGI PHP request from the same poll.

If you use a wrapper around the php spawning process you can supply 
another php.ini that will be used.  With php5 you can also supply 
runtime configurations while spawning.

You can also load the mod htscanner into php that will scan .htaccess 
files for php settings (btw in php6 this will be default so no need to 
load htscanner for 6, not that there are a lot of ppl running 6 atm but 
still).  Apache will bork when trying to read the htaccess file (with 
php settings) because it will not understand the php settings there. 
There are 2 options (I use them both). 1. wrap the php settings stuff in 
  <IfModule {some none existant mod, like mod_php4.c}> [setting here] 
</IfModule> to prevent Apache reading them (mod_php4 is not loaded so no 
problem), and htscanner will ignore the IfModule stuff. 2. load a dummy 
php mod that will only tell Apache it uses the php settings [and does 
absolutely nothing with them].

--
Michiel Brandenburg



More information about the FastCGI-developers mailing list