J'ai migré l'un des sites Web Joomla et j'ai été bloqué avec une "Erreur fatale PHP Erreur non interceptée :appel à la fonction non définie apc_fetch()". Si vous êtes bloqué avec une erreur similaire, voici comment vous pouvez la résoudre. Avant cela, voici l'instantané de l'erreur :
Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /var/www/libraries/joomla/cache/storage/apc.php:35 Stack trace: #0 /var/www/libraries/joomla/cache/cache.php(188): JCacheStorageApc->get('ab82b3238b14dcb...', 'Gantry', true) #1 /var/www/libraries/joomla/cache/controller.php(179): JCache->get('ab82b3238b14dcb...', 'Gantry') #2 /var/www/libraries/gantry/core/utilities/cache/joomlaCacheDriver.class.php(40): JCacheController->get('ab82b3238b14dcb...', 'Gantry') #3 /var/www/libraries/gantry/core/utilities/cache/cache.class.php(135): JoomlaCacheDriver->exists('Gantry', 'ab82b3238b14dcb...') #4 /var/www/libraries/gantry/core/utilities/gantrycache.class.php(240): GantryCacheLib->get('Gantry', 'ab82b3238b14dcb...') #5 /var/www/libraries/gantry/gantry.php(269): GantryCache->addWatchFile('/var/www/cfw_pr...') #6 /var/www/libraries/gantry/gantry.php(432): gantry_setup() #7 /var/www/templates/rt_cla in /var/www/libraries/joomla/cache/storage/apc.php on line 35
Comment corriger l'erreur fatale PHP – Appel à la fonction non définie apc_fetch() ?
Solution : En regardant l'erreur, il est clair que l'application attend PHP APC module à activer.
Il existe deux façons de le résoudre :
Option 1 : Installez le module PHP APC à l'aide de la commande ci-dessous :
#apt-get install php7.0-apc
Redémarrez ensuite le serveur Web
#/etc/init.d/apache2 restart
Option 2 : Si vous ne voulez pas qu'APC soit utilisé pour la mise en cache, désactivez-le simplement. Ouvrez configuration.php fichier et recherchez la ligne ci-dessous :
public $cache_handler = 'apc';
Et remplacez-le par :
public $cache_handler = 'file';
De cette façon, Joomla utilisera un fichier comme gestionnaire de cache au lieu d'APC.
Voila, Joomla fonctionne très bien maintenant !