Jeremy Davis's picture

As I said my memory of all this stuff is a little rusty as it was quite a while ago since I was actively working on this transition stuff. Sorry if my lack of clarity and/or foggy memories lead you astray.

Anyway, to be a bit more explicit, IIRC as of PHP5.5 (or perhaps it was 5.6? regardless, as of PHP in Debian 8/Jessie) Opcache is integrated into PHP itself. AFAIK Debian compile PHP using the PHP defaults, so enabled for Apache by default; disabled for cli. FYI the PHP Opcache docs cover the options and their defaults. I assume that it covers Opcache for all versions as there does not seem to be version specific variations of that page (or at least not that I could find).

Anyway, to disable it for Apache, you need to uncomment the relevant lines and set it/them to 0. Same (but opposite) for cli. I.e. uncomment the relevant lines and set it/them to 1.

As for xcache. I think it's somewhat similar, although it's not baked into PHP. IIRC if the package is installed, it's enabled by default via directly symlinking the module (via phpenmod), thus enabling it, without modifying php.ini. AFAIK it can still be explicitly disabled within php.ini. Now my memory has been jogged though, it's probably better to disable it via php5dismod (FWIW in Debian 9/Stretch / TurnKey v15.x - it's phpdismod). IIRC the module is (as you'd probably expect) is called xcache, so phpsdismod xcache should do the trick. Alternatively removing the package will also do the trick. I.e.

apt-get remove php5-xcache

Having said all that, as I noted, AFAIK at best it's of no value to have then both enabled, at worst will cause issues.

Hope that helps.