Can APC and OpCache co-exist in PHP5.4

Wyatt Barnett asked:

We are generally running php 5.4.x with APC enabled on CENTOS for our production sites. We have a new app that is segfaulting and the development team thinks it is because we’ve got APC. The app is complicated and really needs an opcode cache.

We have a number of existing apps happily using APC for their opcode and other caching needs that we don’t really want to QA so what we’d love to do is just install the OpCache extension along side the APC extension and then let apps enable or disable as they will. I cannot, however, find any indication this will or won’t work so before we get to messing with chef to make this happen I’d love to get some insight on that.

My answer:


You can’t have more than one opcode cache loaded at the same time; only one or the other will actually run, and the other will throw an error when it attempts to load.

You will need to remove APC when you install OPcache.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.