• Resolved WebsThatRock

    (@websthatrock)


    WebsThatRock 

    (@websthatrock)

    2 days ago

    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?

    Michael

    When 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 241
    Error: 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 pub

    When 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 34
    Parse 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 48
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

    WebsThatRock 

    (@websthatrock)

    2 days ago

    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)
  • 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

    (@websthatrock)

    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/ 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

    (@websthatrock)

    I just used the plugins to delete the transients but when I try another import the same errors pop up.

    Moderator James Huff

    (@macmanx)

    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/ if you have any of their paid WooCommerce products or https://www.ads-software.com/support/plugin/woocommerce/ if you do not.

    Thread Starter WebsThatRock

    (@websthatrock)

    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.

    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

    (@websthatrock)

    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

    (@websthatrock)

    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.