Doctrine undefined function apc_fetch
Asked Answered
K

6

17

I'm using this tutorial, which gives a detail explanation about how to set up CodeIgniter and Doctrine. I'm using CodeIgniter 2.1.0 and Doctrine 2.2.1, but I get this error:

Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() in /Applications/XAMPP/xamppfiles/htdocs/emma_watson_shrine/application/libraries/Doctrine/Common/Cache/ApcCache.php on line 52

Can you help me out?

Kavanaugh answered 30/10, 2012 at 15:58 Comment(0)
N
12

You need to enable the APC extension for PHP.

Follow this guide.

Alternatively, you could use a different caching driver, like memcache, and change the Doctrine config in accordance to that.

Check the doctrine documentation for alternate caching drivers. Perhaps the simplest solution would be to use ArrayCache in development.

Naoma answered 31/10, 2012 at 15:2 Comment(0)
S
5

Since php 5.5 apc is no longer used. You should install apcu.

E.g.

apt install php5.6-apcu

More info here:

http://php.net/manual/en/opcache.installation.php

And for those on php 7 there's a backwards compatibility module:

apt-get install php7.0-apcu
apt-get install php7.0-apcu-bc

Also, you might need to add this repository:

apt-add-repository ppa:ondrej/php
apt-get update
Sharika answered 12/2, 2017 at 21:41 Comment(0)
A
4

If you don't install APC and just want to run it then in doctrine-cli.php at line 6, change mode:

define('ENVIRONMENT', 'production');

to

define('ENVIRONMENT', 'development');

Open Doctrine.php file, at line 36 ~ 43, you will see why!

Antiphon answered 26/6, 2013 at 2:15 Comment(0)
W
1

you need to install apc extension to work with caching. So just download the extension and install it.

This one will help you to install APC extension on apache.

http://kvcodes.com/2014/06/solution-call-undefined-function-apc_fetch/

Whitcomb answered 9/6, 2014 at 5:1 Comment(0)
A
0

For anyone getting this on a Mac, just install apcu using Homebrew:

brew install php56-apcu

(and enable the extension, if required).

Adulteration answered 20/11, 2017 at 15:4 Comment(1)
Error: No available formula with the name "php56-apcu"Habilitate
H
0

On OSX I had to run:

pecl channel-update pecl.php.net
pecl install apcu-4.0.11

to install for PHP 5.6

https://getgrav.org/blog/macos-mojave-apache-mysql-vhost-apc

Habilitate answered 1/10, 2018 at 13:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.