0

Lets say that I have two versions of the same file. One is app/v1/lib/ExampleClass.php, and another resides in app/v2/lib/ExampleClass.php. To conserve memory, xcache creates opcache for only single version of those files. But the problem arises when v1 or v2 is modified, and xcache persistently serves the wrong opcache. In the past I've always separated php-fpm master processes for different app versions. I don't have that luxury this time, but the problem remains. Is there any other way to go around this?

OS: Debian 8 PHP: Version 5.6.30 XCache: Version 3.2.0

Palethorn
  • 103
  • 3

1 Answers1

0

XCache hasn't been updated since 2014. PHP 5.6 has its own OPCode cache, http://php.net/manual/en/book.opcache.php. You should use that instead of XCache.

If you need user variable caching, you need to get APCu and use that.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • It's pretty late now to switch to APCu and Zend OPCache. Future plans involve using redis for var cache in combination with zend opcache. I was wondering if there is any current solution to this. – Palethorn Mar 21 '17 at 12:32
  • You can try disabling XCache OPCode caching by setting `xcache.cacher=0` in the .ini file, and then switch Zend OPCache on. This change is not a big one. – Tero Kilkanen Mar 21 '17 at 12:39
  • Ok, I'll try that. – Palethorn Mar 21 '17 at 12:48