I have installed APCu extension in PHP7
But I get this error
Call to undefined function apc_fetch()
Starting with PHP 7.0, APCu removed the option for full backwards compatibility with APC that existed with APCu in PHP 5.5 and 5.6.
You will need to add the APCu Backwards Compatiblity Module on top of apcu to make it work. (https://pecl.php.net/package/apcu_bc)
pecl install apcu_bc
You need to install apcu and apcu backward compatibility for PHP7
On Ubuntu 14.xx you first need to install php7.0 by using the repo:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0
Then
sudo apt-get install php7.0-apcu
sudo apt-get install php7.0-apcu-bc
Then restart apache
For ubuntu 16.xx. You can already install apcu
sudo apt-get install php-apcu
Then add the repo:
sudo add-apt-repository "deb http://ftp.de.debian.org/debian sid main"
sudo apt-get update
then
sudo apt-get install php-apcu-bc
Such an installation doesnt work for me - ubuntu doesnt have apcu-bc package.
apt-get install php7.0-apcu-bc
My installation
sudo apt-get install php-dev
sudo pecl install apcu_bc-beta
After that I changed /etc/php/7.0/mods-available/apcu-ini to
extension=apcu.so
extension=apc.so
Note, that apc.so must be AFTER apcu
APC and APCu are different modules.
You have APCu installed, however, you are using APC functions.
Try apcu_fetch or install apc, if that is possible for PHP7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With