skip to Main Content

after a migration from ubuntu 18;04 to 20.04, my php site comes up with an error in the apache logs

 [Tue Apr 23 23:09:52.521788 2024] [:error] [pid 4026] [client 10.164.136.69:39608] PHP Fatal error:  Uncaught Kohana_Cache_Exception [ 0 ]: PHP APC extension is not available. ~ MODPATH/cache/classes/kohana/cache/apc.php [ 52 ]n  thrown in /var/www/*/cache/apc.php on line 52

when I check in the file at line 52, this is what I get

 48         protected function __construct(array $config)
 49         {
 50                 if ( ! extension_loaded('apc'))
 51                 {
 52                         throw new Kohana_Cache_Exception('PHP APC extension is not available.');
 53                 }
 54
 55                 parent::__construct($config);
 56         }

any idea where the problem might be coming from?

by default the site was on php 5.6, after migration to ubuntu 20.04, php 7 was installed by default, I ran commands to switch php 7.4 to 5.6 but no change

2

Answers


  1. Chosen as BEST ANSWER

    phpinfo()

    PHP Version => 5.6.40-57+ubuntu18.04.1+deb.sury.org+1

    System => Linux "host" 5.15.0-1061-azure #70~20.04.1-Ubuntu SMP Mon Apr 8 15:38:58 UTC 2024 x86_64 Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /etc/php/5.6/cli Loaded Configuration File => /etc/php/5.6/cli/php.ini Scan this dir for additional .ini files => /etc/php/5.6/cli/conf.d Additional .ini files parsed => /etc/php/5.6/cli/conf.d/10-opcache.ini, /etc/php/5.6/cli/conf.d/10-pdo.ini, /etc/php/5.6/cli/conf.d/15-xml.ini, /etc/php/5.6/cli/conf.d/20-bcmath.ini, /etc/php/5.6/cli/conf.d/20-bz2.ini, /etc/php/5.6/cli/conf.d/20-calendar.ini, /etc/php/5.6/cli/conf.d/20-ctype.ini, /etc/php/5.6/cli/conf.d/20-curl.ini, /etc/php/5.6/cli/conf.d/20-dom.ini, /etc/php/5.6/cli/conf.d/20-exif.ini, /etc/php/5.6/cli/conf.d/20-fileinfo.ini, /etc/php/5.6/cli/conf.d/20-ftp.ini, /etc/php/5.6/cli/conf.d/20-gd.ini, /etc/php/5.6/cli/conf.d/20-gettext.ini, /etc/php/5.6/cli/conf.d/20-iconv.ini, /etc/php/5.6/cli/conf.d/20-imagick.ini, /etc/php/5.6/cli/conf.d/20-json.ini, /etc/php/5.6/cli/conf.d/20-mbstring.ini, /etc/php/5.6/cli/conf.d/20-mcrypt.ini, /etc/php/5.6/cli/conf.d/20-phar.ini, /etc/php/5.6/cli/conf.d/20-posix.ini, /etc/php/5.6/cli/conf.d/20-readline.ini, /etc/php/5.6/cli/conf.d/20-shmop.ini, /etc/php/5.6/cli/conf.d/20-simplexml.ini, /etc/php/5.6/cli/conf.d/20-soap.ini, /etc/php/5.6/cli/conf.d/20-sockets.ini, /etc/php/5.6/cli/conf.d/20-sysvmsg.ini, /etc/php/5.6/cli/conf.d/20-sysvsem.ini, /etc/php/5.6/cli/conf.d/20-sysvshm.ini, /etc/php/5.6/cli/conf.d/20-tokenizer.ini, /etc/php/5.6/cli/conf.d/20-wddx.ini, /etc/php/5.6/cli/conf.d/20-xmlreader.ini, /etc/php/5.6/cli/conf.d/20-xmlwriter.ini, /etc/php/5.6/cli/conf.d/20-xsl.ini

    PHP API => 20131106 PHP Extension => 20131226 Zend Extension => 220131226 Zend Extension Build => API220131226,NTS PHP Extension Build => API20131226,NTS Debug Build => no Thread Safety => disabled Zend Signal Handling => disabled Zend Memory Manager => enabled Zend Multibyte Support => provided by mbstring IPv6 Support => enabled DTrace Support => enabled

    Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv2, tls, tlsv1.0, tlsv1.1, tlsv1.2 Registered Stream Filters => zlib., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, bzip2., convert.iconv., mcrypt., mdecrypt.


  2. i solved my problem with this command line

    sudo apt-get update
    sudo apt-get install php5.6-apcu
    

    Add or ensure the following line exists in the php.ini file:

    extension=apcu.so
    

    restart apache

    sudo service apache2 restart
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search