Regarding the php.ini files management with i-MSCP

  • Hello ;


    This thread is intended to clarify how i-MSCP manages the php.ini files, according the way you are running PHP.


    I. i-MSCP frontEnd (control panel) php.ini file


    The i-MSCP control panel runs it own instance of PHP FPM. Its php.ini file is located at /usr/local/etc/imscp_panel/php.ini and its FPM pool configuration file at /usr/local/etc/imscp_panel/php/php-fpm.conf


    Note that these files only apply to the control panel. For the customer sites, see below.


    Important: If you modify one of these files, don't forget to restart the imscp_panel service.


    II. Customers sites


    I Apache2 with MPM ITK


    When using Apache with the MPM ITK (therefore, with mod_php), only one php.ini file located at /etc/php5/apache2/php.ini or /etc/php/<version>/apache2/php.ini is relevant for all your customers. If you change a parameter in this file, it will apply to all your customers. However you must note that any parameter defined in the vhost file take precedence over those set in the php.ini file.


    You can also edit (override) some parameters via the i-MSCP PHP Editor. These parameters are defined in the Apache vhost file of the customer for which you are acting.


    Important: When you modify a parameter manually in the php.ini file, you must restart the Apache2 service.


    II. Apache2 with Fcgid


    When using Apache with Fcgid, PHP is running as CGI program. Each customer has its own php.ini file located at /var/www/fcgi/<domain.tld>/php<version>/php.ini


    You can change some parameters via the i-MSCP PHP Editor. These parameters are defined in the php.ini file of the customer for which you are acting.


    Note: This "mode" also allows to have more than one php.ini file per customer:


    - per_user: each customer will have only one php.ini file
    - per_domain: each domain / domain alias will have its own php.ini file
    - per_vhost: each vhost for domain, domain alias, subdomain and subdomain alias will have its own php.ini file


    Important: When you modify a parameter manually in a php.ini file, you must restart the Apache2 service.


    III. Apache2 with PHP-FPM


    When using Apache with php-fpm, only one php.ini file located at /etc/php5/fpm/php.ini or /etc/php/<version>/fpm/php.ini is relevant for all your customers. If you change one parameter in this file, it will apply to all your customers.


    However each customer has a least one php-fpm pool configuration file located under /etc/php5/fpm/pool.d or /etc/php/<version>/fpm/pool.d, in which you can override PHP parameters (read the documentation about php-fpm carefully).


    You can also change some parameters via the i-MSCP PHP Editor. These parameters are defined in the customer php-fpm pool file.


    Note: This "mode" also allows to have more than one php.ini file per customer:


    - per_user: each customer will have only one pool
    - per_domain: each domain / domain alias will have its own pool
    - per_site: each site will have its own pool


    Important: When you modify a parameter manually in the php.ini file or a php-fpm pool file, you must restart the php5-fpm service.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().


  • II Apache2 with Fcgid or FastCGI
    Important: When you modify a parameter manually in a php.ini file, you must restart (reload) the Apache2 service.


    Reloading has no effect. If there's no instance (php-cgi) in the corresponding user's context running, you have to do nothing :-) The next request is served by a "fresh php-child" that covers your changes.
    If there is at least one active instance you have to kill it - or you have to restart apache (which in fact for the cgi-child is the same).

    Edited once, last by biologist ().


  • Reloading has no effect. If there's no instance (php-cgi) in the corresponding user's context running, you have to do nothing :-) The next request is served by a "fresh php-child" that covers your changes.
    If there is at least one active instance you have to kill it - or you have to restart apache (which in fact for the cgi-child is the same).


    I'll process some test. ;)


    Thanks

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • PHP Fpm

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • is it possible to change when server is already setup and users on it ?


    With latest RC releases, yes.


    Code
    1. # perl imscp-autoinstall -dr httpd

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().

  • Try to change /var/www/fcgi/<domain.tld>/php5/php.ini but after apache restarting php option session.gc_maxlifetime return to default ? What am I doing wrong ?!