Doctrine undefined function apc_fetch

我怕爱的太早我们不能终老 提交于 2019-12-03 23:32:34

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.

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!

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

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/

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

brew install php56-apcu

(and enable the extension, if required).

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

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