0

We would like to 'migrate' our project to use opcache, instead of apc. How can we do this?

On our VPS, we have php 5.6 installed with opcache.enable => On, however, our assets won't load and Doctrine shows several errors in the logfile. (Because Doctrine is still trying to call ApcCache)

2015/02/16 15:22:21 [error] 22231#0: *29515 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() in snip_path/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php on line 40" while reading response header from upstream, client: snip_ip, server: snip_server, request: "GET /app_dev.php/js/57b7149_part_1_templates_2.js HTTP/1.1", upstream: "fastcgi://unix:/var/run/php_fpm_cynex.sock:", host: "snip_host", referrer: "snip_referer"

Ruben
  • 796
  • 3
  • 9
  • 21

3 Answers3

1

You may be using apc with doctine orm, please check app/config/config.yml

doctrine:
   orm:
      ...
      metadata_cache_driver: apc
      ...

Refer

If you are using it, you need to disbale it, clear cache and try it.

Hope this may help you.

Mathlight
  • 6,436
  • 17
  • 62
  • 107
Yogesh Salvi
  • 1,177
  • 2
  • 10
  • 17
0

Doctrine is trying to use APC cache driver wich is probably turned off in your VPS.

zim32
  • 2,561
  • 1
  • 24
  • 31
  • We can read the error, too. Maybe the question wasn't clear: How do we migrate a Symfony2.5 project away from using APC? – Ruben Feb 16 '15 at 14:51
  • 2
    Do you really need it? Opcache is php accelerator, while APC is accelerator AND key value storage. You can use both (opcache for php boost and APC for caching variables) – zim32 Feb 16 '15 at 14:53
0

While I'm not familiar with Doctrine, the issue seems to be that Doctrine is behaving like APC is installed, which it clearly isn't

PHP Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch()

Apparently Doctrine wants to control Opcache in ways it's not designed to perform

PHP's OpCache is not a full blown cache as APC It is a simply opcode cache.

Community
  • 1
  • 1
Machavity
  • 30,841
  • 27
  • 92
  • 100