Can zend opcode cache and APC cache run together on same server

alternative-php-cachecachephp-fpm

I am on a dedicated server – running multiple portals in respective virtual directories. Some of the previously loaded websites are using Zend opcode cache. While my new commerce portal uses an APC based cache and I have migrated this website to the new server.

I am having frequent internal server 500 errors and crashes.

I am having following config:

  • PHP 5.4.27 and APC 3.1.13,
  • Centos server with about 4 GB ram,
  • APC is using php-fpm

Zend opcode cache config:

Opcode Caching  Up and Running
Optimization    Enabled
Startup OK
Shared memory model mmap
Cache hits  71322
Cache misses    1049
Used memory 13544916
Free memory 42838688
Wasted memory   10725260
Cached scripts  298
Cached keys 309
Max keys    3907

APC config:
shm_size = 2024M
..and so on…

Could this be a possible reason for crashes? Do i need to disable one of them or can they run together. I am afraid disabling zend should not cause issues to other websties – so just wanted to be sure?

Best Answer

It is a very probable cause of crashing. If your software do not use apc key cache, but only opcache, then upgrade to Zend OPcache should just work. If you use apc key cache, then there will be some programming involved to migrate to some other key caching solution like memcached. From php 5.4 and up most benchmarks show a reasonable speed up using Zend OPcache vs APC.