fix opcache.validate_root after php update

Discussion in 'Installation/Configuration' started by fanto666, Jan 9, 2023.

  1. fanto666

    fanto666 Member

    Hello,
    I have updated PHP packages installed from packages.sury.org.
    Now, there were new versions of php.ini configuration files available, with default value of opcache.validate_root (disabled) while current php.ini files contain:

    7.3/apache2/php.ini: opcache.validate_root = 1
    7.3/cgi/php.ini: opcache.validate_root = 1
    7.3/cli/php.ini: ;opcache.validate_root=0
    7.3/fpm/php.ini: opcache.validate_root = 1
    8.1/cgi/php.ini: opcache.validate_root = 1
    8.1/cli/php.ini: ;opcache.validate_root=0
    8.1/fpm/php.ini: opcache.validate_root = 1

    I don't remember of modifying these files so I assume ISPConfig modifies these on install.
    can I force ISPConfig to do that again or am I required to modify these manually?

    I have tried to run update.php without success.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No, that's not the case. ISPCopnfig is not modifying these files at all.
     
  3. fanto666

    fanto666 Member

    I have tested just now, ispconfig-3.2.8p1 on debian 10, tested 3 times (long live vm snapshots).
    Before ispconfig installation:

    ispconfig-test.slovanet.sk etc # grep -Fir opcache.validate_root php/
    php/7.3/fpm/php.ini:;opcache.validate_root=0
    php/7.3/cgi/php.ini:;opcache.validate_root=0
    php/7.3/apache2/php.ini:;opcache.validate_root=0
    php/7.3/cli/php.ini:;opcache.validate_root=0

    shortly after ispconfig installation:

    ispconfig-test.slovanet.sk etc # grep -Fir opcache.validate_root php/
    php/7.3/fpm/php.ini:;opcache.validate_root=0
    php/7.3/cgi/php.ini:;opcache.validate_root=0
    php/7.3/apache2/php.ini:;opcache.validate_root=0
    php/7.3/cli/php.ini:;opcache.validate_root=0

    within a minute or two:

    ispconfig-test.slovanet.sk etc # grep -Fir opcache.validate_root php/
    php/7.3/fpm/php.ini: opcache.validate_root = 1
    php/7.3/cgi/php.ini: opcache.validate_root = 1
    php/7.3/apache2/php.ini: opcache.validate_root = 1
    php/7.3/cli/php.ini:;opcache.validate_root=0


    the script /usr/local/ispconfig/server/plugins-available/webserver_plugin.inc.php does contain code to, citation:
    "// ensure opcache.validate_root = 1"
     
    till likes this.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, I was not aware that we have that functionality builtin. Without opcache root validation, the opcache will mix up contents between websites, so this should be set to 1 indeed, except for cli.
     
  5. fanto666

    fanto666 Member

    I was not aware of this functionality too, that's when I asked.

    When I install ISPConfig, current php version php.ini files got modified with opcache.validate_root=1.
    When I configured additional PHP version, the same happened with that version's php.ini files.

    This did not happen when php version got updated (security fix).

    Is there a reason why the update could get unnoticed?

    I can report if this happens again.
     
  6. fanto666

    fanto666 Member

    I have upgraded PHP 8.1 to new version in Debian 10 and the php.ini files (i installed new versions) are there with default values of:
    ;opcache.validate_root=0

    perhaps this should be re-checked time to time.

    Can I enforce this somehow or do I have to configure those manually?
     
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  8. fanto666

    fanto666 Member

    It's this thread FYI.

    As I see, this happens automatically after a delay, e.g. I have upgraded packages at 17:38, posted my question (confused) at 17:47.
    At 17:56 the files were changed.


    So it is this delay that has confused me.
    Sorry for the noise.
    So yes, it does happen automatically, but the delay can get us confused.
     
  9. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    LOL oops. You can set the interval yourself, I think it happens automatically every 15 minutes.
     

Share This Page