Attempted to call function “apc_fetch” from namespace “Doctrine\Common\Cache”

人走茶凉 提交于 2019-12-25 03:38:25

问题


I've APC installed on my server, wondering if I'm missing something else. I want to be able to cache a 3rd party API request.

     code -
      $cache = new \Doctrine\Common\Cache\ApcCache();

      $data =  $cache->fetch('namesaved');

      if($data === false) { 
      $cache->save('namesaved','keyword');
      } 

      returns -     
     Attempted to call function "apc_fetch" from namespace 
     "Doctrine\Common\Cache" in      vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php line 40.

回答1:


You are getting this error because the function apc_fetch could not be found. This means that either APC is not (correctly) installed, or that the module is not loaded in the PHP config.



来源:https://stackoverflow.com/questions/33017218/attempted-to-call-function-apc-fetch-from-namespace-doctrine-common-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!