It is impossible to specify different php.ini files for each virtual host.
However, you can leave common php.ini settings in the php.ini file, and
specify differences between virtual hosts like described here:
http://groups.google.com/group/highload-php-en/browse_thread/thread/2aa55858046fad17
--
Andrei Nigmatulin
GPG PUB KEY 6449830D
Now I lay me down to sleep(3)
Pray the OS my core to keep
If I die before I wake
Pray the Disk my core to take
> http://groups.google.com/group/highload-php-en/browse_thread/thread/2aa55858046fad17
It works like a charm.
I can set each fastcgi pool to have it's own error log (one pool per customer)
For the customers that need development logging, I can set
display_errors on for them. Otherwise since it's production systems I
set it to off in php.ini.
However in PHP 5.3 you'll be able to do some conditional type things
in php.ini as well so you could wait and do it then too. See here:
http://www.php.net/ini.sections
That actually might be a little more useful even so I can just define
some dev hosts, instead of having to define a separate fastcgi pool in
php-fpm so I can enable display_errors.
> How in one php-fpm.conf put options for a vhost and not for another.
>
> <workers>
> <section name="pool">
> ...
> <value name="php_defines">
> <value name="apc.enabled">0</value>
> ...
> </value>
> ...
> </section>
>
> <section name="pool">
> ...
> <value name="php_defines">
> <value name="apc.enabled">1</value>
> ...
> </value>
> ...
> </section>
> </workers>
>
> How <section with name="pool">, vhost will go to the conf 1 or 2 ?
You configure the webserver to send requests to the specific pool
which is listening on a specific TCP ip/port or a socket. That is
unique per pool. That is how you map your fastcgi requests to a
specific pool.
Your nginx.conf should look like this:
server {
...
location ~ \.php$ {
...
fastcgi_pass 127.0.0.1:9000;
}
}
server {
...
location ~ \.php$ {
...
fastcgi_pass 127.0.0.1:8000;
}
}
Next, you need to put this line "apc.enabled=1" into php.ini.
The last step: configure two separate pools of workers in one php-fpm.conf:
<workers>
<section name="pool">
<value name="listen_address">127.0.0.1:8000</value>
...
<value name="php_defines">
<value name="apc.enabled">0</value>
...
</value>
...
</section>
<section name="pool">
<value name="listen_address">127.0.0.1:9000</value>
...
</section>
</workers>
The first pool of php-fastcgi workers will be listening on port 8000 and have
ini option apc.enabled == "0" (disabled).
The second one will be listening on port 9000 and have default "apc.enabled"
value from php.ini, which is "1" (enabled).