Call to undefined function opcache_reset()

Written by James McDonald

March 14, 2018

Got this error message

2018/03/13 22:12:41 [error] 17149#0: *7057 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined function opcache_reset() in /path/to/wordpress/wp-content/plugins/opcache/opcache.php:72

And then created a file named opcache.php and ran it with php opcache.php


if (function_exists('opcache_reset') ) {

echo "OPCache Reset Exists\n";

} else {

echo "OPCache does not exist\n";

## output was 
OPCache does not exist

Ran php -i to get the text version of the phpinfo() function to see if PHP had OPCache installed and got nada.

php -i | grep -i opcache

Did a yum search to see if it was available in the repo and then installed it

yum search opcache
Loaded plugins: etckeeper, priorities, update-motd, upgrade-helper
1034 packages excluded due to repository priority protections
============================= N/S matched: opcache =============================
php-pecl-zendopcache.x86_64 : The Zend OPcache
php55-opcache.x86_64 : The Zend OPcache
php56-opcache.x86_64 : The Zend OPcache
php70-opcache.x86_64 : The Zend OPcache
php71-opcache.x86_64 : The Zend OPcache

yum install php71-opcache

# restart php-fpm

service php-fpm restart
Stopping php-fpm-7.1: [ OK ]
Starting php-fpm-7.1: [ OK ]

# check for it again


php -i | grep -i opcache
Additional .ini files parsed => /etc/php-7.1.d/10-opcache.ini,
with Zend OPcache v7.1.13, Copyright (c) 1999-2017, by Zend Technologies
Zend OPcache
opcache.blacklist_filename => /etc/php-7.0.d/opcache*.blacklist => /etc/php-7.0.d/opcache*.blacklist
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On

#.... heaps of out put

Problem finito!


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…