php-switcher and php.ini

  • Hi I have php-switcher installed on my IMSCP, it works well however I cannot get the default php.ini settings to be read!


    I am using php 5.6 in /opt/phpswitcher/php5.6/ and the php.ini is /opt/phpswitcher/php5.6/etc/php/php.ini


    I have verified the ini in use with php_ini_loaded_file() and I have configured my max upload file size from 2M to 50M BUT it's still stuck on 2M! Verified with ini_get('upload_max_filesize').


    I have restarted php 56fpm (service psw5.6-fpm restart) and apache too. But still it is saying 2M, why is it not reading my changes? The /opt/phpswitcher/php5.6/etc/php/php.ini looks correct and sets the value to 50M (once only).


    there must be some simple explanation here but I cannot see it, please can someone help?

  • @tjfayaz120


    The upload_max_filesize directive value from the /opt/phpswitcher/php5.6/etc/php/php.ini file is overridden in the domain fpm pool configuration file. Thus, editing the /opt/phpswitcher/php5.6/etc/php/php.ini is totally useless. See the file under /opt/phpswitcher/php5.6/etc/php-fpm.d.


    Furthermore, the upload_max_filesize value should be set through the frontEnd. Editing the file manually is a bad thing because your change will be cleared on next i-MSCP update or any change of a domain propertie.

    • Connect as administrator and edit the reseller properties (PHP editor permissions), that is the reseller that you used to create the domain (customer account).
    • Connect as reseller and edit customer domain properties (PHP editor permissions).

    You're done.


    Note that there is not problem at all here. All is about your understanding of i-MSCP and PHP. Please read the documentation available at: https://wiki.i-mscp.net/doku.php?id=plugins:phpswitcher and more specially that part: https://wiki.i-mscp.net/doku.p…cher#specific_to_fpm_sapi

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