1

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.

Wyatt Barnett
  • 725
  • 5
  • 14

2 Answers2

1

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • TS should rather disable APC in the PHP's config than remove it. Multiple cachers can be installed while only one of them can be enabled. – Kondybas Oct 21 '15 at 23:49
  • @Kondybas -- thanks that is kind of what we are looking to do, could you elaborate a bit? – Wyatt Barnett Oct 22 '15 at 15:24
  • There is file called `extensions.ini` that contains list of enabled php-extensions. Just comment out line `extension=apc.so` by semicolon and there it is. – Kondybas Oct 22 '15 at 15:57
1

Latest APC snapshot (3.1.15-dev) can work with opcache (using apc.enable_opcode_cache=0 and apc.shm_strings_buffer=0), but in all case, this extension is dead, unmaintained.

If you use opcache and need to cache user data, see APCu extension which is a dropin replacement of APC, without the opcode cache.

https://pecl.php.net/package/APCu

Both php-pecl-zendopcache and php-pecl-apcu package are available in EPEL repository.

Remi Collet
  • 2,061
  • 1
  • 11
  • 12