Search code examples
phpapcopcache

Opcache equivalent function to apc store


We need to upgrade the php version from 5.3 to 5.5 of one project that´s using APC. So, as I´ve seen in php 5.5 there is a new cache library to use instead of apc, opcache. I have read the docs and I have a few doubts.

Actually, in one specific part of the project we are using the apc store and fetch functions to store some data, but I haven´t seen any similar functions to do the same task with opcache. The question is simple, is it possible to do the same with opcache?

Thanks in advance.


Solution

  • You can restore the store and fetch functions by installing APCu

    sudo apt-get install php5-apcu

    By installing APCu extension_loaded('apc') will return true as well and you don't need to rename any of the old functions used.

    I'm using this on a debian with PHP5.6 with OPCache enabled

    source