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.