"apc_fetch" error, but with php-apcu installed and running

0

I am installing on a ubuntu server 16.04 a site with apache / php7 / mysql for a symfony application, which currently works on another server.

When trying to access this new server, the log gives me:

[2017-04-26 11:45:16] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedFunctionException: "Attempted to call function "apc_fetch" from namespace "Doctrine\Common\Cache"." at /var/www/mydomain/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php

Checking several stackoverflow threads I see that it is usually an error of badly installed apcu.

When trying a:

sudo apt-get install php-apcu

Apt tells me that it is already installed:

user@server:/# sudo apt-get install php-apcu
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php-apcu is already the newest version (5.1.3+4.0.10-1build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

and if I prepare a php file with phpinfo (); he returns the corresponding table and looking for apcu I find:

apcu

APCu Support            Enabled
Version                 5.1.3
APCu Debugging          Disabled
MMAP Support            Enabled
MMAP File Mask          no value
Serialization Support   php
Build Date              Apr 5 2016 02:16:47

I have also reviewed the php packages installed. I get the list with dpkg -l | grep php:

blackfire-php             
dh-php                    
libapache2-mod-php        
libapache2-mod-php7.0     
newrelic-php5             
newrelic-php5-common      
php-apcu                  
php-cli-prompt            
php-common                
php-composer-semver       
php-composer-spdx-licenses
php-imagick               
php-json-schema           
php-pear                  
php-symfony-console       
php-symfony-filesystem    
php-symfony-finder        
php-symfony-process       
php7.0                    
php7.0-cli                
php7.0-common             
php7.0-curl               
php7.0-dev                
php7.0-fpm                
php7.0-intl               
php7.0-json               
php7.0-mbstring           
php7.0-mysql              
php7.0-opcache            
php7.0-readline           
php7.0-xml                
php7.0-zip                
pkg-php-tools  

I'm pretty confused. It gives the impression that it is installed correctly, but the app indicates that it fails.

Any ideas about it?

    
asked by Jakala 26.04.2017 в 11:57
source

1 answer

0

Solved. the problem was that php-apcu does not include the function apc_fetch (and other necessary of my project). The solution has been to install another module called apcu_bc, with the line

pecl install apcu_bc-beta

I found this here: link

Thanks

    
answered by 27.04.2017 в 09:35