php.ini vs custom order

Discussion in 'ISPConfig 3 Priority Support' started by elmacus, Nov 16, 2018.

Tags:
  1. elmacus

    elmacus Member HowtoForge Supporter

    Hi.
    We have a /etc/php/7.0/mods-available/local.ini file with some settings for ex. max_input_vars = 3000, so that our modifications survive Debians PHP upgrades. PHP default is 1000.
    This work, until you set max_input_vars in custumers Custom php.ini settings to 5000, (due to Wordpress theme demands.)
    Then the local.ini still overrides this custum.ini.
    Is this by design or bug ?
    Is there a better way than using local.ini so PHP changes is not overwritten ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Set the global default values in the php.ini file of that php version instead of an include.
     
  3. elmacus

    elmacus Member HowtoForge Supporter

    Sorry, but that global file /etc/php/7.0/cgi/php.ini is ovewritten by Debian. Or do you mean another file ?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The file /etc/php/7.0/cgi/php.ini is not overwritten by Debian.
     
  5. elmacus

    elmacus Member HowtoForge Supporter

    It has on my systems. So many times a have changed max_upload_size from 2 to 128 MB, and after some updates, its gone again.
    Well, it might ask if its ok or not while using apt. So i always answer "yes", to get updates.
     
  6. elmacus

    elmacus Member HowtoForge Supporter

    When you use /etc/php/7.0/mods-available/local.ini it is used by Apache2, cgi, cli, and fpm at the same time.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    I won't let apt overwrite a php.ini on a production system, makes no sense as the content of that file just has to match the major PHP version and an update with apt will not change the major php version.
     
    elmacus likes this.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Correct, as that's the way to force override custom settings that you might have made in ISPConfig as this file takes precedence over a custom php.ini file that you set for PHP.
     
    elmacus likes this.
  9. elmacus

    elmacus Member HowtoForge Supporter

    I was just tired of that question that i haved changed PHP.ini so, problem was to reapply my changes, and found the local.ini.
    But i agree, there should be no changes to php.ini, also from Debian side, they might have changed behavoir also, becouse the latest security updates on PHP there where no questions on to update php.ini (could also be that i use local and dont see anymore).
    Thanks for feedback on the matter.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Juts a guess, you refer to php 7.2 but php 7.2 does not exist in Debian stable. Maybe you installed it from a third party repo which updates php.ini in opposite to Debian which does not update it? I have all my custom php settings in the global php.ini on my Debian systems for years now and run updates automatically and I don't loose them. So I suspect that your experience might be from using a repo that is not Debian core?

    In any case, there is no easy way to work around this as PHP reads files from conf.d after it's ini file and ispconfig writes into an ini file which is basically the global php.ini with custom values appended and I don't see how ISPConfig could tell PHP to read conf.d before its own php.ini file and custom settings per site cannot be put in global conf.d
     
  11. elmacus

    elmacus Member HowtoForge Supporter

    No, just 7.0, Debian Stable. I will change the global ini file, and remove the local.ini.
    Thanks for help.
     

Share This Page