Rodolphe
A php.ini for each virtualhost ?
November 06, 2010 01:26PM
Hi,

I tested PHP-FPM, all is fine.

I've got several virtualhosts, and I would like to know how to define
a php.ini for each ?

What do I need to write in the vhost conf file ?

Thanxx a lot

R.CARMIGNANI
Brandon Amaro
Re: A php.ini for each virtualhost ?
November 06, 2010 01:34PM
As far as I know, you can't do that with PHP-FPM but you can do
something similar to what you want in the PHP-FPM configuration files.
I'm sure someone can explain it a lot better than me but you can have
PHP-FPM listen to more than one port (each port for a different virtual
host). In the configuration for each port you can override the settings
in the php.ini file.

--
omega13a
Owner and Founder of UFT
http://www.fedtrek.com


On 11/06/2010 10:17 AM, Rodolphe wrote:
> Hi,
>
> I tested PHP-FPM, all is fine.
>
> I've got several virtualhosts, and I would like to know how to define
> a php.ini for each ?
>
> What do I need to write in the vhost conf file ?
>
> Thanxx a lot
>
> R.CARMIGNANI
>
>
Jonathan Langevin
Re: A php.ini for each virtualhost ?
November 06, 2010 03:52PM
For PHP-FPM, use ini sections: http://www.php.net/manual/en/ini.sections.php
http://www.php.net/manual/en/ini.sections.phpWithout PHP-FPM:
http://www.php.net/manual/en/configuration.file.per-user.php

http://www.php.net/manual/en/configuration.file.per-user.phpIt's possible
that PHP-FPM supports the file-per-user INI option now in 5.3.3 (dunno), so
it would be smart to test both options, see which works.

On Sat, Nov 6, 2010 at 1:17 PM, Rodolphe <rcarmignani@gmail.com> wrote:

> Hi,
>
> I tested PHP-FPM, all is fine.
>
> I've got several virtualhosts, and I would like to know how to define
> a php.ini for each ?
>
> What do I need to write in the vhost conf file ?
>
> Thanxx a lot
>
> R.CARMIGNANI
>
>
Ofutur
Re: A php.ini for each virtualhost ?
January 06, 2011 12:12AM
I've tried both methods and none worked using Apache 2.2 (I'm connecting
through a socket).

Using php-fpm.conf would work when using one pool per user, but it doesn't
really make sense. We want things like register_globals to be defined by
domain.
It's not realistic to create one pool per vhost, that would launch too many
processes.

I guess it's back to using htscanner...
Sammie Taunton
Re: A php.ini for each virtualhost ?
January 06, 2011 09:46PM
The newest version of FPM does support php.ini but make sure your php conf is enabled for this feature and the naming convention is set to php.ini and not the default .user.ini. When changes are made FPM needs to be reloaded for those changes to take effect. I think, havnt tested, that the php.ini is per-directory too and not for all folders under the root domain.

Sent from my iPhone

On Jan 5, 2011, at 22:47, Ofutur <ofutur@gmail.com> wrote:

> I've tried both methods and none worked using Apache 2.2 (I'm connecting through a socket).
>
> Using php-fpm.conf would work when using one pool per user, but it doesn't really make sense. We want things like register_globals to be defined by domain.
> It's not realistic to create one pool per vhost, that would launch too many processes.
>
> I guess it's back to using htscanner...
Olivier
Re: A php.ini for each virtualhost ?
January 06, 2011 09:56PM
I couldn't find a way to define a php.ini per pool in php-fpm.conf
Is that what you mean?
There doesn't seem to be a switch in the main php.ini file that would
let people enable per folder php.ini.

I did manage to get php-fpm to use a .user.ini file in the end. The
problem is that changes are tracked, by default, every 5 minutes, so I
was assuming changes were not picked up when I just had to be patient or
restart php-fpm.

It never worked with a php.ini, with or without restarts, but that
wouldn't really work for domains anyway. Who would want to have an extra
php.ini file in every directory?

I've also managed to use HOST= when enabling php-fpm on a single domain,
while the others were using mod_php. I wonder if that's the mix that is
creating problems when more domains are enabled.



On 07/01/2011 02:43, Sammie Taunton wrote:
> The newest version of FPM does support php.ini but make sure your php conf is enabled for this feature and the naming convention is set to php.ini and not the default .user.ini. When changes are made FPM needs to be reloaded for those changes to take effect. I think, havnt tested, that the php.ini is per-directory too and not for all folders under the root domain.
>
> Sent from my iPhone
>
> On Jan 5, 2011, at 22:47, Ofutur <ofutur@gmail.com> wrote:
>
>> I've tried both methods and none worked using Apache 2.2 (I'm connecting through a socket).
>>
>> Using php-fpm.conf would work when using one pool per user, but it doesn't really make sense. We want things like register_globals to be defined by domain.
>> It's not realistic to create one pool per vhost, that would launch too many processes.
>>
>> I guess it's back to using htscanner...
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 119
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready