Call to undefined function opcache_reset()

by | Mar 14, 2018 | IT Tips, Wordpress | 0 comments

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
 
if (function_exists('opcache_reset') ) {
 
echo "OPCache Reset Exists\n";
 
opcache_reset();
} 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.

1
php -i | grep -i opcache

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
 
&nbsp;
 
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!

0 Comments

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.