11

Since PHP 5.5 broke APC in favor of their own cache, I'm trying to get my Symfony2 project running with APCu instead, and it doesn't like it:

$ php app/console cache:clear --env=prod --no-warmup
PHP Fatal error:  Call to undefined function Doctrine\Common\Cache\apc_fetch() in /home/maf/symfony/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php on line 40

The documentation of APCu is basically non-existent, and the Symfony2 docs are outdated, providing help only for APC.

I regret using PHP these days with all the compatibility-breaking upgrades, but I need to get my project running again. Where do I apply the gaffer tape?

halfer
  • 19,824
  • 17
  • 99
  • 186
Tom
  • 2,688
  • 3
  • 29
  • 53

1 Answers1

10

You should make sure that you have APC support emulated, so make sure that you have extension=apcu.so (version >= 4.0) in your php.ini.

APC support emulated on PHP 5.5

Anton Babenko
  • 6,586
  • 2
  • 36
  • 44
  • I have that, and APCu seems to work (at least the web-frontend tells me so). I still get the above error. – Tom Jan 11 '14 at 14:55
  • 6
    Make sure that web and cli version of php.ini has it (`php -i | grep php.ini`, `php -m | grep apc`). I have no other advice at the moment. – Anton Babenko Jan 12 '14 at 10:16
  • 3
    That was it, thank you. Yes, I had it installed only for the web, not for the CLI, and Symfony2 calls it as CLI on cache clear. Thanks. – Tom Jan 12 '14 at 10:40