WP-CLI not working on Lightning

I’m having an issue running WP-CLI commands from the site shell.

OS X 10.15.3
ZSH 5.8
Local 5.2.5

Site 1 - custom
PHP 7.4.1
MySQL 8.0.16
WP-CLI 0.23.0
WordPress 5.3.2

Site 2 - custom
PHP 7.4.1
MySQL 5.7.28
WP-CLI 0.23.0
WordPress 5.3.2

Any wp-cli command results in the message Cannot load Zend OPcache - it was already loaded

The only commands that seem to work are wp core version and wp cli version.

All other commands result in the above message with no other output, no warnings, no errors but most importantly, the command does not run.

Site 3 - preferred

PHP 7.3.5
MySQL 5.7.28
WP-CLI 0.23.0
WordPress 5.3.2

Not getting the OPcache message but am seeing the following messages:

The Zend Engine API version 320190902 which is installed, is newer.
The Zend Engine API version 320190902 which is installed, is newer.

Fatal error: Uncaught Error: Call to undefined function apply_filters() in …/app/public/wp-includes/load.php:322

I’d appreciate any thoughts or suggestions.

Thanks,
Mark

While trying out Local I had similar, issue because Local Lightning uses a custom PHP.ini file and on the fly adds the socket.

My temporary hack was to add
if ( defined( ‘WP_CLI’ ) && WP_CLI ) {
ini_set(‘mysqli.default_socket’, ‘{path to socket}’);
}
Where path to socket, is the path indicated on the database panel In the Local app for that site.
Right at the top of the wp-config.php

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.