Title: WP-CLI Parse error with APCu Manager
Last modified: November 8, 2024

---

# WP-CLI Parse error with APCu Manager

 *  Resolved [André Brückner](https://wordpress.org/support/users/tichypress/)
 * (@tichypress)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/)
 * Hi Pierre,
 * with active APCu Manager I cannot use wp commands, I always get:
 * >Parse error: syntax error, unexpected ‘|’, expecting variable (T_VARIABLE) in../
   wp-content/plugins/apcu-manager/includes/libraries/decalog-sdk/EventsLogger.php
   on line 76
 * With deactivated APCu, but still activated Decalog plugin, the error changes 
   to:
 * >Parse error: syntax error, unexpected ‘|’, expecting variable (T_VARIABLE) in../
   wp-content/plugins/decalog/includes/api/class-logger.php on line 60
 * Everything is up to date, PHP is 8.1 – any idea what to do about this?
 * Regards, André

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Arnaud](https://wordpress.org/support/users/charlyaes32/)
 * (@charlyaes32)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/#post-18126994)
 * Solution is here (maybe):
   Go on your ftp on : /wp-content/plugins/apcu-manager/
   includes/libraries/decalog-sdk/EventsLogger.php and edit line 76 like this:
 *     ```wp-block-code
       public function emergency( $message, array $context = [] ): void { // Vérifier si $message est un string ou un objet Stringable if ( !is_string( $message ) && !( $message instanceof Stringable ) ) { throw new InvalidArgumentException( 'Le paramètre $message doit être une chaîne de caractères ou un objet Stringable.' ); } if ( !is_array( $context ) ) { $context = [ 'code' => 30973 ]; $this->debug( 'Wrong method argument: $context must be an array.', $context ); } foreach ( $this->loggers as $logger ) { $logger->emergency( (string) $message, array_key_exists( 'code', $context ) ? (int) $context['code'] : 0 ); } }
       ```
   
 *  Thread Starter [André Brückner](https://wordpress.org/support/users/tichypress/)
 * (@tichypress)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/#post-18131681)
 * Hi Arnaud,
 * thanks for your reply! Yes, in a way it solves the problem.
 * There were 8 more occurences in EventsLogger.php I had to “prepare”. Then the
   error moved to plugins/decalog/includes/api/class-logger.php with again several
   occurences (every message type). But with your solution, I could in a way fix
   them all.
 * So, for the moment I can run wp commands without error.
 * Thanks again! André
 *  Thread Starter [André Brückner](https://wordpress.org/support/users/tichypress/)
 * (@tichypress)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/#post-18159644)
 * Hi Arnaud,
 * I hoped the issue would be solved with the update of APCu Manager to a new version,
   but as far as I can read the diff 4.0.0 > 4.1.0, this is not the case. Can you
   confirm? Is it planned to change APCu Manager in near future to solve the issue?
   Or is there anything I can do to make my environment compatible?
 * Regards, André
 *  Plugin Author [Pierre Lannoy](https://wordpress.org/support/users/pierrelannoy/)
 * (@pierrelannoy)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/#post-18193981)
 * Hi [@tichypress](https://wordpress.org/support/users/tichypress/)
 * _Now that the checkbox (about WPE) to connect to wp.org has been removed, I can
   finally reconnect. Sorry for the inconvenience and if it happens again, feel 
   free to go through Github: there’s none of that bullshit about WP vs WPE._
 * Your issue is due to your PHP version. I can assure you this error tells you:
   you don’t meet plugin requirements. Mainly, you’re not using PHP 8.X…
 * Do you have this error in your site, or only when you use wp-cli?
 *  Thread Starter [André Brückner](https://wordpress.org/support/users/tichypress/)
 * (@tichypress)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/#post-18194346)
 * Hi Pierre,
 * your pointing out what’s wrong here: the website is running on PHP 8.1, BUT wp-
   cli runs 7.4 – I had overseen this diff.
 * Thanks for your help!
 * André

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WP-CLI Parse error with APCu Manager’ is closed to new replies.

 * ![](https://ps.w.org/apcu-manager/assets/icon-256x256.png?rev=2225345)
 * [APCu Manager](https://wordpress.org/plugins/apcu-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/apcu-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/apcu-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/apcu-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/apcu-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/apcu-manager/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [André Brückner](https://wordpress.org/support/users/tichypress/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/wp-cli-parse-error-with-apcu-manager/#post-18194346)
 * Status: resolved