Error when trying to flush the OPcache using wp-cli

May 17, 2026 | IT Tips | 0 comments

Written By James McDonald

Error:

Unable to query OPcache status: array_key_exists(): Argument #2 ($array) must be of type array, false given.

Resolution:

Make sure opcache.enable_cli=1 is enabled in the cli php.ini at /etc/php/8.3/cli/php.ini (on Debian)

To find the php.ini and PHP version

# See version 
php -v 

# view php.ini
php -i | grep "Loaded Configuration File"
Loaded Configuration File => /etc/php/8.3/cli/php.ini

# edit  /etc/php/8.3/cli/php.ini
vim  /etc/php/8.3/cli/php.ini
# or 
nano  /etc/php/8.5/cli/php.ini

# set to 1
opcache.enable_cli=1


Written By James McDonald

undefined

Explore More IT Insights

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.