4

Does anyone know much about the opcache option opcache.dups_fix? The documentation states "This hack should only be enabled to work around "Cannot redeclare class" errors." We are seeing said errors that can really only be attributed to an opcache problem. We have opcache.revalidate_freq set to 0, so every request should generate a check on the file, but it seems that at certain times, files are being included in the cache twice, generating the error.

I'm mainly curious in the potential side effects of enabling the dups_fix option. Sounds like the solution to our problem, but the wording in the documentation isn't real encouraging...

habiem
  • 51
  • 5
  • In case it leads to any clues, this appears to be the code that is actually affected by that option: https://php-lxr.adamharvey.name/source/xref/master/ext/opcache/zend_accelerator_util_funcs.c#561 Unfortunately, version control is no help here, because it predates the open source release from Zend Technologies, so everything just blames back to a code dump. – IMSoP Aug 30 '17 at 14:29
  • Thanks. We're not C experts here, but best we can tell it just doesn't use cache if this option is on AND there is a collision. Better than throwing a fatal. We're going to give it a try in a staging environment and see how it goes. Thanks for pointing us to this! – habiem Aug 31 '17 at 13:22

0 Answers0