Title: Parse error: syntax error, unexpected &#8216;:&#8217;, expecting error is showing
Last modified: August 23, 2022

---

# Parse error: syntax error, unexpected ‘:’, expecting error is showing

 *  Resolved [adii123](https://wordpress.org/support/users/adii123/)
 * (@adii123)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/)
 * hi, i have updated the woocommerce to latest version. this error is appearng
 * Parse error: syntax error, unexpected ‘:’, expecting ‘{‘ in /public_html/wp-content/
   plugins/woocommerce/woocommerce.php on line 56
 * on this function
    function wc_get_container() : \Psr\Container\ContainerInterface{
   return $GLOBALS[‘wc_container’]; }
 * Please help me inresolving this issue

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/page/2/?output_format=md)

 *  [Austin M – a11n](https://wordpress.org/support/users/apmwebdev/)
 * (@apmwebdev)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13330253)
 * Hi [@adii123](https://wordpress.org/support/users/adii123/)! I’d be glad to help
   you with this. Where is this error appearing? Are you still able to get to your
   dashboard? If so, WooCommerce still showing as active? Is the front end of your
   site affected at all?
 * If you’re able to, can you post your system status report? You can find that 
   by going to WooCommerce > Status in your dashboard, then clicking “Get system
   report,” then “Copy for support.” That will give me a better idea of what we’re
   dealing with here.
 *  [masakoonishi](https://wordpress.org/support/users/masakoonishi/)
 * (@masakoonishi)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13330993)
 * I’m getting the very same error message. So I’d very much appreciate it if a 
   resolution could be posted here.
 * I did end up resolving the issue (White screen of death(WSOD)) by restoring a
   backup from the previous day, but I’d still like to know the resolution.
 *  Thread Starter [adii123](https://wordpress.org/support/users/adii123/)
 * (@adii123)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13335321)
 * this is the link
    [http://ahmadbilalcouture.com/](http://ahmadbilalcouture.com/)
 * I can,t login to admin due to this issue that’s why i can,t send system report
 * Please help me in resolving this issue. my website is down from 5 days
 * thank you
 *  [masakoonishi](https://wordpress.org/support/users/masakoonishi/)
 * (@masakoonishi)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13335715)
 * [@adii123](https://wordpress.org/support/users/adii123/) are you able to restore
   the site using a backup?
 *  [Austin M – a11n](https://wordpress.org/support/users/apmwebdev/)
 * (@apmwebdev)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13336049)
 * Hi [@adii123](https://wordpress.org/support/users/adii123/). Do you have access
   to your site through some other means? cpanel or FTP or anything like that? If
   so, I’d recommend going to `wp-content/plugins` in your site’s home directory
   and removing the WooCommerce folder completely. If need be, you can get a previous
   version of the plugin [here](https://wordpress.org/plugins/woocommerce/advanced/)
   and upload that to your plugins folder the same way.
 * Once you’re able to get access to your site, I’d recommend [creating a staging site](https://robotninja.com/blog/staging-environment-woocommerce/)
   and testing updates there first going forward.
 * With your staging site created, I would try disabling all plugins except for 
   WooCommerce, switching to a default theme like Twenty Twenty, and then trying
   the update again. Hopefully, it is just the update itself that is broken, and
   things will work normally once the update is complete.
 *  [michaelsngws](https://wordpress.org/support/users/michaelsngws/)
 * (@michaelsngws)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13342668)
 * I would also like to chime in that I am having the same problem.
 * I am upgrading from WooCommerce 4.3.3 to 4.4.1 when I get this problem that creates
   the error that makes access to the website not possible,
 * I have switched to the default Twenty Twenty theme and is still getting the problem.
   I have since loaded up a backup from my website host cpanel.
 * So now my website is functional, but I am not able to update to WooCommerce 4.4.1
 *  [Cheerycops](https://wordpress.org/support/users/davercheshire/)
 * (@davercheshire)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13348961)
 * I’m also experiencing issue with this error although it does not stop me getting
   into WPADMIN, Also it appears intermittent. I have taken the development site
   back to Woo V4.4.0 to no effect. **I’m keen to know as this is appearing on the
   live site to customers.**
 * [http://www.wizardmodels.ltd](http://www.wizardmodels.ltd)
 *  [Cheerycops](https://wordpress.org/support/users/davercheshire/)
 * (@davercheshire)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13349028)
 * Update; service side is running PHP version: 5.6.40 and Woo suggest upgrading
   this to 7.2
 * They sent these links on min requirements.
 * [https://docs.woocommerce.com/document/update-php-wordpress/](https://docs.woocommerce.com/document/update-php-wordpress/)
 * h[ttps://docs.woocommerce.com/document/server-requirements/](https://docs.woocommerce.com/document/server-requirements/)
 *  [Austin M – a11n](https://wordpress.org/support/users/apmwebdev/)
 * (@apmwebdev)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13358276)
 * Hi all! Were you able to try the update with all plugins disabled and a default
   theme?
 * > Update; service side is running PHP version: 5.6.40 and Woo suggest upgrading
   > this to 7.2
 * Yes, you should definitely update your PHP version if you’re running an old version
   of PHP. Did this solve your problem [@davercheshire](https://wordpress.org/support/users/davercheshire/)?
 *  [michaelsngws](https://wordpress.org/support/users/michaelsngws/)
 * (@michaelsngws)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13359039)
 * Writing to confirm that updating my PHP to 7.3 (in my case) solved my problem.
 * Thanks to all who helped raise this issue.
 *  [Austin M – a11n](https://wordpress.org/support/users/apmwebdev/)
 * (@apmwebdev)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13390115)
 * Great, I’m glad to hear it! I’ll leave the thread open for a little longer in
   case other people have the same issue and upgrading their PHP version doesn’t
   fix the issue, but hopefully that will do it.
 *  [misocio](https://wordpress.org/support/users/misocio/)
 * (@misocio)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13390593)
 * It solved my issue even though I only renamed all woocommerce folders through
   cpanel.
    Thanks [@apmwebdev](https://wordpress.org/support/users/apmwebdev/)
 *  [Austin M – a11n](https://wordpress.org/support/users/apmwebdev/)
 * (@apmwebdev)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13421236)
 * Sure thing! There hasn’t been any movement on this thread in a while, so I’m 
   going to go ahead and mark it as resolved. Feel free to open a new thing with
   any further questions!
 *  [lvl99](https://wordpress.org/support/users/lvl99/)
 * (@lvl99)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13636488)
 * I’m running PHP 7.4 and WooCommerce 4.6.2 and I still get the issue:
 * `syntax error, unexpected ':', expecting '{' in plugins/woocommerce/woocommerce.
   php on line 56`
 *  [Stefan M.](https://wordpress.org/support/users/stefan-m-1/)
 * (@stefan-m-1)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/#post-13880645)
 * When Using WP Cli, the error gets also reported:
 * **php -v**
 *     ```
       PHP 7.4.8 (cli) (built: Jul 10 2020 16:20:04) ( NTS )
       Copyright (c) The PHP Group
       Zend Engine v3.4.0, Copyright (c) Zend Technologies
           with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies
       ```
   
 * **wp –info**
 *     ```
       OS:     Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) x86_64
       Shell:  /bin/bash
       PHP binary:     /opt/plesk/php/7.4/bin/php
       PHP version:    7.4.8
       php.ini used:   /opt/plesk/php/7.4/etc/php.ini
       WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
       WP-CLI vendor dir:      phar://wp-cli.phar/vendor
       WP_CLI phar path:       /var/www/vhosts/swiss-qube.ch/httpdocs/swiss-qube.ch/www
       WP-CLI packages dir:
       WP-CLI global config:
       WP-CLI project config:
       WP-CLI version: 2.4.0
       ```
   
 * **sudo -u swiss-qube wp plugin update –all**
 *     ```
       PHP Parse error:  syntax error, unexpected ':', expecting '{' in /var/www/vhosts/swiss-qube.ch/httpdocs/swiss-qube.ch/www/wp-content/plugins/woocommerce/woocommerce.php on line 56
       Parse error: syntax error, unexpected ':', expecting '{' in /var/www/vhosts/swiss-qube.ch/httpdocs/swiss-qube.ch/www/wp-content/plugins/woocommerce/woocommerce.php on line 56
       Error: Es gab einen kritischen Fehler auf Ihrer Website.Erfahren Sie mehr über die Fehlerbehebung in WordPress. Es gab einen kritischen Fehler auf Ihrer Website.
       ```
   
 * Website runs fine, but breaks wp-cli, which also using 7.4.8 as you can see. 
   What the hell for a messy new programming way. I know its “new” but hell is it
   not update friendly.

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/page/2/?output_format=md)

The topic ‘Parse error: syntax error, unexpected ‘:’, expecting error is showing’
is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)

 * 27 replies
 * 20 participants
 * Last reply from: [hargobind](https://wordpress.org/support/users/hargobind/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-error-is-showing/page/2/#post-15451470)
 * Status: resolved