Title: WP CLI Parse Error
Last modified: March 13, 2024

---

# WP CLI Parse Error

 *  Resolved [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * (@websthatrock)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/)
 * [WebsThatRock](https://wordpress.org/support/users/websthatrock/) 
   (@websthatrock)
   [2 days ago](https://wordpress.org/support/topic/wp-cli-syntax-errors-in-source-code/#post-17488315)
   Hello, using CLI PHP version PHP 7.3.33 and WooCommerce version 8.22 and tested
   again on version 8.6.1 when trying to run the CLI I get these error messages.
   Is this a bug that needs to be reported? Do I need CLI to use version PHP 7.4?
   MichaelWhen testing with WooCommerce 8.22 I get this error.Parse error: syntax
   error, unexpected ‘?’, expecting function (T_FUNCTION) or const (T_CONST) in /
   home/mtgshopp/public_html/wp-content/plugins/wp-all-import-pro/addon-api/classes/
   helpers.php on line 241Error: There has been a critical error on this website.
   Learn more about troubleshooting WordPress. There has been a critical error on
   this website.[mtgshopp@cloud-9dc319 pubWhen testing with WooCommerce 8.6.1 I 
   get this error.arning: class_implements(): Class Automattic\WooCommerce\Internal\
   TransientFiles\TransientFilesEngine does not exist and could not be loaded in/
   home/mtgshopp/public_html/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/
   ServiceProviders/AbstractInterfaceServiceProvider.php on line 34Parse error: 
   syntax error, unexpected ‘LegacyProxy’ (T_STRING), expecting function (T_FUNCTION)
   or const (T_CONST) in /home/mtgshopp/public_html/wp-content/plugins/woocommerce/
   src/Internal/TransientFiles/TransientFilesEngine.php on line 48Error: There has
   been a critical error on this website.Learn more about troubleshooting WordPress.
   There has been a critical error on this website.[WebsThatRock](https://wordpress.org/support/users/websthatrock/)(
   @websthatrock)[2 days ago](https://wordpress.org/support/topic/wp-cli-syntax-errors-in-source-code/#post-17488407)
   I just had the host upgrade the PHP to 7.4 for the CLI and it received the same
   error.

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

 *  [Jon Brown](https://wordpress.org/support/users/jb510/)
 * (@jb510)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17494548)
 * WPAI Pro does require PHP 7.4 or higher. 
   Being a commerical plugin with dedicated
   support you should seek assistance from WP All Import Pro support directly if
   you’re still getting the `Parse error: syntax error, unexpected ‘?’` error after
   upgrading to PHP 7.4.The second error is often associated with PHP versions as
   well. Do be aware that WP CLI may be running a different version of PHP than 
   the web server is configured to run.`php --version` on the command line will 
   tell you which version you’re actually using.While PHP 7.4 is the minimum required
   by these plugins, you should test and consider upgrading to PHP 8.0 or 8.2 which
   are current.
 *  Thread Starter [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * (@websthatrock)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17494915)
 * Thank you, I’ve been doing some testing and came up with some answers. I restored
   the database and files from March 1st and the import worked fine BUT when I clicked
   on “unsuspend transients” from the plugin Transients Manager from [https://www.wpbeginner.com/](https://www.wpbeginner.com/)
   the errors popped up and I cannot import via CLI. What can be done to clean up
   the transients on the website?
 *  Thread Starter [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * (@websthatrock)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17494942)
 * I just used the plugins to delete the transients but when I try another import
   the same errors pop up.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17495056)
 * Are the errors consistently for WooCommerce?
 * If so, I recommend getting in touch with WooCommerce’s support about this via
   [https://woo.com/my-account/contact-support/](https://woo.com/my-account/contact-support/)
   if you have any of their paid WooCommerce products or [https://wordpress.org/support/plugin/woocommerce/](https://wordpress.org/support/plugin/woocommerce/)
   if you do not.
 *  Thread Starter [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * (@websthatrock)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17495127)
 * Thank you, I will try there. In the meantime I’m trying to delete all of the 
   transients to see if that will solve the problem.
 *  [Jon Brown](https://wordpress.org/support/users/jb510/)
 * (@jb510)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17495784)
 * This isn’t an issue with the transients. It’s a PHP error from running an ancient
   version of PHP. Update to the current version of PHP, 8.2.
 *  Thread Starter [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * (@websthatrock)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17497679)
 * Hi, I tried that and that didn’t work. I did however set up a testing blank WordPress
   with the bare minimal and the error still shows up there as well.
 *  Thread Starter [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * (@websthatrock)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17497820)
 * Problem got solved. It turned out the CLI PHP version was 7.3. I contacted the
   host and they changed it to 7.4 and with a special CLI command to update to force
   it to 7.4 it worked. I found out online that since WooCommerce 8.6 this error
   is caused if the CLI is less than 7.3 even if the website itself is 7.4 or higher.

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

The topic ‘WP CLI Parse Error’ is closed to new replies.

## Tags

 * [transients](https://wordpress.org/support/topic-tag/transients/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 3 participants
 * Last reply from: [WebsThatRock](https://wordpress.org/support/users/websthatrock/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-parse-error/#post-17497820)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
